{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "# 读取 Excel 文件\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generate_city_26():\n",
    "    df = pd.read_excel('./data/中国各城市空间权重矩阵(1).xlsx', sheet_name='地理距离矩阵')\n",
    "    provinces = df.iloc[:, 0].values\n",
    "    # citys = df.iloc[:, 1].values\n",
    "    # matrix = df.iloc[0:, 3:].values\n",
    "    distance_matrix = df.iloc[:, 3:]\n",
    "    city_index = 2\n",
    "    distance_matrix.index = df.iloc[:, city_index].values\n",
    "    distance_matrix.columns = df.iloc[:, city_index].values\n",
    "\n",
    "    # 挑选出安徽、江苏、浙江和上海的省份及对应的矩阵数据\n",
    "    selected_provinces = ['Anhui', 'Jiangsu', 'Zhejiang', 'Shanghai']\n",
    "    # selected_cities = df[df['proveng'].isin(selected_provinces)]['cityeng'].tolist()\n",
    "    selected_indices = [i for i, prov in enumerate(provinces) if prov in selected_provinces]\n",
    "    # selected_matrix = matrix[selected_indices, :]\n",
    "    selected_indices_str = df.values[selected_indices, city_index]\n",
    "    # 从城市列表中随机选择25个城市（不包括上海）\n",
    "    selected_index = pd.Index(selected_indices_str)\n",
    "    # 使用 loc 方法选择相应的行和列\n",
    "    selected_data = distance_matrix.loc[selected_index, selected_index]\n",
    "    np.random.seed(42)\n",
    "    # print(selected_indices_str[0])\n",
    "    random_cities = np.random.choice(selected_indices_str[1:], 25, replace=False)\n",
    "    # print(len(random_cities))\n",
    "    # 将上海添加到随机选择的城市列表中\n",
    "    # City158 = shanghai\n",
    "    selected_cities_26 = ['City158'] + random_cities.tolist()\n",
    "    print(len(selected_cities_26))\n",
    "    selected_index_26 = pd.Index(selected_cities_26)\n",
    "    # 使用 loc 方法选择相应的行和列\n",
    "\n",
    "\n",
    "    selected_data_26 = selected_data.loc[selected_index_26, selected_index_26]\n",
    "    city_to_city_series = df[['cityeng', 'cityseries']].drop_duplicates().set_index('cityeng')['cityseries'].to_dict()\n",
    "    city_series_to_city = df[['cityeng', 'cityseries']].drop_duplicates().set_index('cityseries')['cityeng'].to_dict()\n",
    "    city_series_26_columns = selected_data_26.columns\n",
    "    city_26_columns = []\n",
    "    for item in city_series_26_columns:\n",
    "        city_26_columns.append(city_series_to_city[item])\n",
    "    city_26 = pd.DataFrame(selected_data_26.values, index=city_26_columns, columns=city_26_columns)\n",
    "    return city_26"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_init_state():\n",
    "    arriving_rate_df = pd.read_excel('./data/数据.xlsx', sheet_name='arriving rate')\n",
    "    travel_fee_df = pd.read_excel('./data/数据.xlsx', sheet_name='travel fee')\n",
    "    initial_state_df = pd.read_excel('./data/数据.xlsx', sheet_name='initial state')\n",
    "    servers_df = pd.read_excel('./data/数据.xlsx', sheet_name='servers') # 员工\n",
    "\n",
    "    # 创建一个包含员工家庭和休假信息的列表A\n",
    "    A = [(servers_df.loc[i, 'home'], servers_df.loc[i, 'day off']) for i in range(1, len(servers_df) + 1)]\n",
    "\n",
    "    # 创建决策空间B\n",
    "    B = []\n",
    "\n",
    "    for i in range(1, len(servers_df) + 1):\n",
    "        home_city, day_off = A[i-1]\n",
    "        decision_set = set()  # 用于存储每个员工的任务分配方案\n",
    "        for city in initial_state_df.index:\n",
    "            for level in range(1, 6):  # 任务级别从1到5\n",
    "                # 检查约束条件\n",
    "                if initial_state_df.at[city, f'level {level}'] > 0 and (city, level) not in decision_set:\n",
    "                    # 如果是员工的周末，将其分配到家中\n",
    "                    if day_off == 1:\n",
    "                        decision_set.add((home_city, 0))\n",
    "                    # 否则分配到相应的城市和级别\n",
    "                    else:\n",
    "                        decision_set.add((city, level))\n",
    "        # 将员工i的决策集合添加到B中\n",
    "        B.append(list(decision_set))\n",
    "\n",
    "    # 现在B包含了所有员工的任务分配方案\n",
    "\n",
    "    # 打印B中的内容，以便检查\n",
    "    for i, decisions in enumerate(B):\n",
    "        print(f\"Server {i + 1} decisions: {decisions}\")\n",
    "    # 1. 40维什么意思？\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[(14, 1), (11, 1), (10, 1), (9, 1), (3, 1), (13, 1), (10, 2), (8, 2), (17, 2), (2, 2), (12, 2), (21, 2), (3, 3), (25, 3), (4, 3), (16, 3), (7, 3), (25, 3), (1, 4), (5, 4), (15, 4), (11, 4), (15, 4), (16, 4), (22, 5), (16, 5), (19, 5), (18, 5), (9, 5), (10, 5), (23, 6), (23, 6), (1, 6), (6, 6), (24, 6), (26, 7), (12, 7), (19, 7), (2, 7), (18, 7)]\n",
      "task_level_counts:\n",
      "level 1     6\n",
      "level 2     5\n",
      "level 3     8\n",
      "level 4    12\n",
      "level 5    12\n",
      "dtype: int64\n",
      "<class 'pandas.core.series.Series'>\n",
      "(5,)\n",
      "server_level_counts:\n",
      "1     5\n",
      "2     5\n",
      "3     7\n",
      "4     9\n",
      "5    14\n",
      "Name: level, dtype: int64\n",
      "<class 'pandas.core.series.Series'>\n",
      "(5,)\n"
     ]
    }
   ],
   "source": [
    "\n",
    "arriving_rate_df = pd.read_excel('./data/数据.xlsx', sheet_name='arriving rate')\n",
    "travel_fee_df = pd.read_excel('./data/数据.xlsx', sheet_name='travel fee')\n",
    "initial_state_df = pd.read_excel('./data/数据.xlsx', sheet_name='initial state')\n",
    "servers_df = pd.read_excel('./data/数据.xlsx', sheet_name='servers') # 员工\n",
    "\n",
    "# 创建一个包含员工家庭和休假信息的列表A\n",
    "A = [(servers_df.loc[i, 'home'], servers_df.loc[i, 'day off']) for i in range(0, len(servers_df))]\n",
    "print(A)\n",
    "\n",
    "# 城市对应等级任务矩阵\n",
    "city_level_matrix_df = initial_state_df.iloc[:, 1:] \n",
    "# 任务计数，用于划分集合\n",
    "task_level_counts = city_level_matrix_df.sum()  \n",
    "# 业务员等级计数，用于划分集合\n",
    "server_level_counts = servers_df['level'].value_counts().sort_index() \n",
    "#根据输入df 确定\n",
    "level_num = task_tasks_counts.shape[0]      # 任务等级数量 \n",
    "city_num = city_level_matrix_df.shape[0]    # 城市数量\n",
    "servers_num = servers_df.shape[0]           # 业务员数量\n",
    "\n",
    "print(f\"task_tasks_counts:\\n{task_tasks_counts}\\n{type(task_tasks_counts)}\\n{task_level_counts.shape}\")\n",
    "print(f\"server_level_counts:\\n{server_level_counts}\\n{type(server_level_counts)}\\n{server_level_counts.shape}\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tasks_info = initial_state_df.iloc[:, 1:]\n",
    "servers_info = servers_df.iloc[:, 1:]\n",
    "print(task_level_counts)\n",
    "print(task_level_counts[0])\n",
    "type(initial_state_df.iloc[:, 1:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1     5\n",
       "2     5\n",
       "3     7\n",
       "4     9\n",
       "5    14\n",
       "Name: level, dtype: int64"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "servers_info['level'].value_counts().sort_index()\n",
    "tasks_info.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 先判断是否可以分配，划分分配的区间，区间内任意分配，\n",
    "def generate_joins(task_level_counts, server_level_counts):\n",
    "    # 输入\n",
    "    # task_level_counts pandas.core.series.Series(level_num,)\n",
    "    # server_level_counts pandas.core.series.Series(level_num,)\n",
    "    # server number tag task number\n",
    "    # level 1 6 > 5\n",
    "    # level 2 2 > 1\n",
    "    # level 3 3 ≤ 6\n",
    "    # level 4 2 > 1\n",
    "    # level 5 4 ≤ 17\n",
    "    # level 6 5 > 4\n",
    "    # level 7 7 > 3\n",
    "    # 需要根据不同等级任务和员工的等级做个计数判断，当连续的每个等级各自同时加起来大于现有的任务等级，表示这一组level之前可以任意分配，可以分配出不同的决策，\n",
    "    # 比如上面的表里level1和level 2 server number >task number ，意味着，level 1可以分配给level2，也可以level2 都分配给level2，这是不同的决策空间，但是level 1 task也必须被做完。当level3 也考虑进去的时候，123相加就server数量就比task少了。这时候level4 就不能和123 一起考虑，但是123 之间可以一起决策，level3 全部分配到task，同时level 2 个也得分配到level3 或者level2\n",
    "    # 输出 return joins = [[1,2,3],[4],[5]]\n",
    "\n",
    "    # 输入校验：\n",
    "    if isinstance(task_level_counts, pd.core.series.Series) \\\n",
    "        and isinstance(server_level_counts, pd.core.series.Series):\n",
    "        if task_level_counts.shape[0] != server_level_counts.shape[0]:\n",
    "            raise Exception(\"输入pandas.core.series.Series形状不一致\")\n",
    "    else:\n",
    "        raise Exception(f\"对象不是Pandas Series task_level_counts:{type(task_level_counts)}, server_level_counts:{type(server_level_counts)}\")\n",
    "    \n",
    "\n",
    "    joins = []  # 存储决策空间的列表\n",
    "    current_join = []  # 当前的决策空间划分\n",
    "    task_level_num = task_level_counts.shape[0]      # 任务等级数量 \n",
    "    task_join_count = 0\n",
    "    server_join_count = 0\n",
    "\n",
    "        # print(\"idx, task_count, server_count, task_join_count, server_join_count\")\n",
    "    for idx, (task_count, server_count) in enumerate(zip(task_level_counts, server_level_counts)):\n",
    "        task_join_count += task_count\n",
    "        server_join_count += server_count\n",
    "        print(idx, task_count, server_count, task_join_count, server_join_count)\n",
    "        level = idx+1\n",
    "        if server_join_count <= task_join_count:\n",
    "            # 当任务数量大于员工数量时，将当前决策空间划分添加到列表中\n",
    "            \n",
    "            if current_join:\n",
    "                current_join.append(level)\n",
    "                joins.append(current_join)\n",
    "            else:\n",
    "                joins.append([level])\n",
    "                \n",
    "            current_join = []  # 重置当前决策空间划分\n",
    "            task_join_count = 0\n",
    "            server_join_count = 0\n",
    "        else:\n",
    "            # 当任务数量小于等于员工数量时，将当前等级添加到当前决策空间划分中\n",
    "            \n",
    "            current_join.append(level)\n",
    "    \n",
    "    if current_join:\n",
    "        joins.append(current_join)  # 将最后一个决策空间划分添加到列表中\n",
    "    \n",
    "    return joins"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "idx, task_count, server_count, task_join_count, server_join_count\n",
      "0 6 5 6 5\n",
      "idx, task_count, server_count, task_join_count, server_join_count\n",
      "1 5 5 5 5\n",
      "idx, task_count, server_count, task_join_count, server_join_count\n",
      "2 8 7 8 7\n",
      "idx, task_count, server_count, task_join_count, server_join_count\n",
      "3 12 9 12 9\n",
      "idx, task_count, server_count, task_join_count, server_join_count\n",
      "4 12 14 12 14\n"
     ]
    }
   ],
   "source": [
    "joins = generate_joins(task_level_counts, server_level_counts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itertools\n",
    "\n",
    "def generate_decision_space(tasks, servers, level_sets):\n",
    "    decision_space = []\n",
    "    servers_num = len(servers)\n",
    "    cities_num = len(tasks)\n",
    "    \n",
    "    # Generate all possible combinations of server-city-task_level tuples\n",
    "    combinations = list(itertools.product(range(cities_num), range(1, 6)))\n",
    "    \n",
    "    # Generate decision space based on valid combinations\n",
    "    for decision in itertools.product(combinations, repeat=servers_num):\n",
    "        valid = True\n",
    "        for i in range(servers_num):\n",
    "            city_idx, task_level = decision[i]\n",
    "            if tasks[city_idx][task_level - 1] != 1:\n",
    "                valid = False\n",
    "                break\n",
    "        if valid:\n",
    "            decision_space.append(decision)\n",
    "    \n",
    "    return decision_space\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "combinations = list(itertools.product(range(servers_num), range(1, 6)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 划分了区间之后，就可以生成所有决策\n",
    "def generate_decisions(servers, tasks):\n",
    "    # 输入\n",
    "    # joins = [[1,2,3],[4],[5]]\n",
    "    # tasks = df[(city_num*level_num)]\n",
    "# level  ~1  ~2  ~3  ~4  ~5\n",
    "# 0       0   0   0\t  1   0\n",
    "# 1       0   0   0\t  1   0\n",
    "    # servers = df[(servers_num*3)]\n",
    "#            home level\tday off\n",
    "# 0\tserver 1\t14\t1\t1\n",
    "# 1\tserver 2\t11\t2\t1\n",
    "    # 对于每个server\n",
    "    # 输出生成所有的决策，但也有约束，比如level5只能做level5的\n",
    "    # return [[()*40],[()*40],[()*40],...,]\n",
    "\n",
    "    task_level_counts = tasks.sum()\n",
    "    # 业务员等级计数，用于划分集合\n",
    "    server_level_counts = servers['level'].value_counts().sort_index() \n",
    "    \n",
    "    joins = generate_joins(task_level_counts, server_level_counts)\n",
    "    decisions_space = []\n",
    "\n",
    "    joins_group = []\n",
    "    # 默认level 从小到大\n",
    "    decision_group = []\n",
    "    for level_join in joins:\n",
    "        state_space_tasks = []\n",
    "        state_space_servers = []\n",
    "        for level in level_join:\n",
    "            specified_tasks = tasks[f\"level {level}\"]\n",
    "            specified_servers = servers[servers['level'] == level].copy()\n",
    "            state_space_tasks.append({f\"level {level}\":specified_tasks})\n",
    "            state_space_servers.append({f\"level {level}\":specified_servers})\n",
    "\n",
    "        # 获取每个等级有几个业务员完成\n",
    "        distribution = []\n",
    "        # 全部置0 值引用\n",
    "        this_servers_num = this_task_num = unfinished_last_task_num = unservered_server_num = 0 \n",
    "        last_level = 0\n",
    "        for level in reversed(level_join):\n",
    "            # 从level大的开始分配，获取有哪些业务员可以分配到指定城市。\n",
    "            print(level)\n",
    "            # key:业务员等级，value:业务员数量\n",
    "            # 业务员等级，任务等级，数量\n",
    "            this_level =f\"level {level}\"\n",
    "            this_servers_num = len(state_space_servers[this_level])\n",
    "            this_task_num = len(state_space_tasks[this_level])\n",
    "            if unfinished_last_task_num:\n",
    "                current_servers_num = \n",
    "                distribution.append((this_level, last_level, this_servers_num,))\n",
    "            task_level = this_level\n",
    "            distribution.append((this_level, task_level, this_servers_num,))\n",
    "            \n",
    "            unfinished_last_task_num = this_task_num - this_servers_num if this_task_num>this_servers_num else 0\n",
    "            unservered_server_num = this_servers_num - this_task_num if this_servers_num>this_task_num else 0\n",
    "            \n",
    "            last_level = level\n",
    "            \n",
    "    return decisions_space"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    home  level  day off\n",
      "0     14      1        1\n",
      "6     10      1        2\n",
      "12     3      1        3\n",
      "18     1      1        4\n",
      "24    22      1        5 <class 'pandas.core.frame.DataFrame'> 5\n",
      "    home  level  day off\n",
      "1     11      2        1\n",
      "7      8      2        2\n",
      "13    25      2        3\n",
      "19     5      2        4\n",
      "25    16      2        5 <class 'pandas.core.frame.DataFrame'> 5\n",
      "    home  level  day off\n",
      "2     10      3        1\n",
      "8     17      3        2\n",
      "14     4      3        3\n",
      "20    15      3        4\n",
      "26    19      3        5\n",
      "30    23      3        6\n",
      "35    26      3        7 <class 'pandas.core.frame.DataFrame'> 7\n",
      "    home  level  day off\n",
      "3      9      4        1\n",
      "9      2      4        2\n",
      "15    16      4        3\n",
      "21    11      4        4\n",
      "27    18      4        5\n",
      "31    23      4        6\n",
      "32     1      4        6\n",
      "36    12      4        7\n",
      "37    19      4        7 <class 'pandas.core.frame.DataFrame'> 9\n",
      "    home  level  day off\n",
      "4      3      5        1\n",
      "5     13      5        1\n",
      "10    12      5        2\n",
      "11    21      5        2\n",
      "16     7      5        3\n",
      "17    25      5        3\n",
      "22    15      5        4\n",
      "23    16      5        4\n",
      "28     9      5        5\n",
      "29    10      5        5\n",
      "33     6      5        6\n",
      "34    24      5        6\n",
      "38     2      5        7\n",
      "39    18      5        7 <class 'pandas.core.frame.DataFrame'> 14\n"
     ]
    }
   ],
   "source": [
    "servers = servers_info\n",
    "tasks = tasks_info\n",
    "# for specified_level in range(1,6):\n",
    "#     specified_tasks = tasks[f\"level {specified_level}\"]\n",
    "#     print(specified_tasks, type(specified_tasks),)\n",
    "\n",
    "# decisions_space = generate_decisions(servers, tasks)\n",
    "for specified_level in range(1,6):\n",
    "    # specified_level =1\n",
    "    specified_servers = servers[servers['level'] == specified_level].copy()\n",
    "    print(specified_servers, type(specified_servers), len(specified_servers))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('task_level_counts',\n",
       " level 1     6\n",
       " level 2     5\n",
       " level 3     8\n",
       " level 4    12\n",
       " level 5    12\n",
       " dtype: int64,\n",
       " 'server_level_counts',\n",
       " 1     5\n",
       " 2     5\n",
       " 3     7\n",
       " 4     9\n",
       " 5    14\n",
       " Name: level, dtype: int64)"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\"task_level_counts\",task_level_counts,\"server_level_counts\", server_level_counts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "def form_combination_dict_list_by_comb(combinations: list[tuple], levels):\n",
    "    \n",
    "    combinations_dict_list = []\n",
    "    for combination in combinations:\n",
    "        comb_list = list(combination)\n",
    "        combination_dict = {}\n",
    "        for a_level, comb in zip(levels, comb_list):\n",
    "            combination_dict.update({a_level:comb})\n",
    "        combinations_dict_list.append(combination_dict)\n",
    "    return combinations_dict_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itertools\n",
    "\n",
    "level_task_dict = {1: 2, 2: 2, 3: 10}\n",
    "level_server_dict = {1: 3, 2: 4, 3: 0}\n",
    "max_level = max(level_task_dict.keys())\n",
    "max_level_server_num = level_server_dict[max_level]\n",
    "distribution = [(max_level, max_level, max_level_server_num,)]\n",
    "\n",
    "# 更新任务列表，减去最大等级的完成任务\n",
    "remain_level_task_dict = level_task_dict.copy()\n",
    "remain_level_server_dict = level_server_dict.copy()\n",
    "remain_level_task_dict[max_level] -= max_level_server_num\n",
    "remain_level_server_dict[max_level] -= max_level_server_num\n",
    "\n",
    "# 两个level 对 进行分配\n",
    "\n",
    "# 计算剩余最大等级任务数量和需要分配的数量\n",
    "max_level_should_allocate_num = remain_level_task_dict[max_level]-max_level_server_num\n",
    "levels = level_task_dict.keys()\n",
    "non_max_levels_num = len(levels) - 1\n",
    "# 生成非最大等级的分配方案\n",
    "\n",
    "no_max_level_ranges = [range(0, remain_level_task_dict[idx+1]+1) for idx in range(non_max_levels_num)]\n",
    "no_max_level_combinations = list(itertools.product(*no_max_level_ranges))\n",
    "\n",
    "no_max_level_combinations_dict_list = form_combination_dict_list_by_comb(no_max_level_combinations, levels=levels)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{1: 0, 2: 0},\n",
       " {1: 0, 2: 1},\n",
       " {1: 0, 2: 2},\n",
       " {1: 1, 2: 0},\n",
       " {1: 1, 2: 1},\n",
       " {1: 1, 2: 2},\n",
       " {1: 2, 2: 0},\n",
       " {1: 2, 2: 1},\n",
       " {1: 2, 2: 2}]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "no_max_level_combinations_dict_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}, {1: 0, 2: 2}, {1: 1, 2: 0}, {1: 1, 2: 1}, {1: 1, 2: 2}, {1: 2, 2: 0}, {1: 2, 2: 1}, {1: 2, 2: 2}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 2}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 2}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 2}\n",
      "level_allocate_num_dict:{1: 0, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}, {1: 1, 2: 0}, {1: 1, 2: 1}, {1: 2, 2: 0}, {1: 2, 2: 1}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 1}\n",
      "level_allocate_num_dict:{1: 0, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 1, 2: 0}, {1: 2, 2: 0}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 2, 2: 0}\n",
      "level_allocate_num_dict:{1: 0, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}, {1: 0, 2: 2}, {1: 1, 2: 0}, {1: 1, 2: 1}, {1: 1, 2: 2}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 2}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 1}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 2}\n",
      "level_allocate_num_dict:{1: 1, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}, {1: 1, 2: 0}, {1: 1, 2: 1}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 1, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 1}\n",
      "level_allocate_num_dict:{1: 1, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 1, 2: 0}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 1, 2: 0}\n",
      "level_allocate_num_dict:{1: 1, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}, {1: 0, 2: 2}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 2, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 2, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 2}\n",
      "level_allocate_num_dict:{1: 2, 2: 0}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}, {1: 0, 2: 1}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 2, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict:{1: 0, 2: 1}\n",
      "level_allocate_num_dict:{1: 2, 2: 1}\n",
      "a_levels:dict_keys([1, 2, 3])\n",
      "max_level_combinations_dict_list:[{1: 0, 2: 0}]\n",
      "max_level_combinations_dict:{1: 0, 2: 0}\n",
      "level_allocate_num_dict:{1: 2, 2: 2}\n",
      "a_levels:dict_keys([1, 2, 3])\n"
     ]
    }
   ],
   "source": [
    "\n",
    "decisions = []\n",
    "for level_allocate_num_dict in no_max_level_combinations_dict_list:\n",
    "    a_remain_level_task_dict = remain_level_task_dict.copy()\n",
    "    a_remain_level_server_dict = remain_level_server_dict.copy()\n",
    "    \n",
    "    a_levels = a_remain_level_server_dict.keys()\n",
    "    for level in level_task_dict.keys():\n",
    "        if level != max_level:\n",
    "            remain_task = level_task_dict[level] - level_allocate_num_dict[level]\n",
    "            remain_server = level_server_dict[level] - level_allocate_num_dict[level]\n",
    "            a_remain_level_task_dict.update({level: remain_task})\n",
    "            a_remain_level_server_dict.update({level: remain_server})\n",
    "\n",
    "\n",
    "    a_max_level_ranges = [range(0, min(a_remain_level_server_dict[idx+1]+1, a_remain_level_task_dict[idx+1]+1)) for idx in range(non_max_levels_num)]\n",
    "    a_max_level_combinations = list(itertools.product(*a_max_level_ranges))\n",
    "\n",
    "    max_level_combinations_dict_list = form_combination_dict_list_by_comb(a_max_level_combinations, levels=a_levels)\n",
    "\n",
    "    print(f\"max_level_combinations_dict_list:{max_level_combinations_dict_list}\")\n",
    "    for max_level_combinations_dict in max_level_combinations_dict_list:\n",
    "        a_decision = []\n",
    "        print(f\"max_level_combinations_dict:{max_level_combinations_dict}\")\n",
    "        print(f\"level_allocate_num_dict:{level_allocate_num_dict}\")\n",
    "        \n",
    "        print(f\"a_levels:{a_levels}\")\n",
    "        for level in a_levels:\n",
    "            # 任务等级，业务员等级，完成数量\n",
    "            if level in level_allocate_num_dict.keys():\n",
    "                a_decision.append((level,level,level_allocate_num_dict[level]))\n",
    "                a_decision.append((max_level,level,max_level_combinations_dict[level]))\n",
    "        decisions.append(a_decision)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[(1, 1, 0), (3, 1, 0), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 0), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 0), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 0), (3, 1, 0), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 0), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 0), (3, 1, 0), (2, 2, 2), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 1), (2, 2, 2), (3, 2, 0)],\n",
       " [(1, 1, 0), (3, 1, 2), (2, 2, 2), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 1), (3, 1, 0), (2, 2, 2), (3, 2, 0)],\n",
       " [(1, 1, 1), (3, 1, 1), (2, 2, 2), (3, 2, 0)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 0), (3, 2, 0)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 0), (3, 2, 1)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 0), (3, 2, 2)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 1), (3, 2, 0)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 1), (3, 2, 1)],\n",
       " [(1, 1, 2), (3, 1, 0), (2, 2, 2), (3, 2, 0)]]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "decisions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4)]\n"
     ]
    }
   ],
   "source": [
    "print(no_max_level_combinations)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<itertools.product at 0x1f46db72100>"
      ]
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import itertools\n",
    "\n",
    "level_task_dict = {1: 2, 2: 2, 3: 10}\n",
    "level_server_dict = {1: 3, 2: 4, 3: 0}\n",
    "max_level = max(level_task_dict.keys())\n",
    "max_level_server_num = level_server_dict[max_level]\n",
    "distribution = [(max_level, max_level, max_level_server_num,)]\n",
    "\n",
    "# 更新任务列表，减去最大等级的完成任务\n",
    "remain_level_task_dict = level_task_dict.copy()\n",
    "remain_level_task_dict[max_level] -= max_level_server_num\n",
    "remain_level_server_dict[max_level] -= max_level_server_num\n",
    "\n",
    "# 计算剩余最大等级任务数量和需要分配的数量\n",
    "max_level_should_allocate_num = remain_level_task_dict[max_level]\n",
    "levels = level_task_dict.keys()\n",
    "non_max_levels_num = len(levels) - 1\n",
    "# 生成非最大等级的分配方案\n",
    "\n",
    "no_max_level_ranges = [range(0, remain_level_server_dict[idx+1]+1) for idx in range(non_max_levels_num)]\n",
    "no_max_level_combinations = list(itertools.product(*no_max_level_ranges))\n",
    "\n",
    "# 给非最大等级每个level 生成\n",
    "for combination in itertools.product(range(max_level_server_num + 1), repeat=non_max_levels_num):\n",
    "    level_allocate_num_dict = {level: allocate_num for level, allocate_num in zip(level_task_dict.keys(), combination)}\n",
    "    level_allocate_num_dict[max_level] = max_level_server_num - sum(combination)\n",
    "\n",
    "    # 检查约束条件，其他等级的分配和不能超过max_level_should_allocate_num\n",
    "    if sum(level_allocate_num_dict.values()) <= max_level_should_allocate_num:\n",
    "        # 生成一个分配方案\n",
    "        distribution.append(tuple(level_allocate_num_dict[level] for level in level_task_dict.keys()))\n",
    "\n",
    "# 根据剩余待分配的任务和服务器数量，生成所有的max level分配方案\n",
    "remain_level_task_dict = {level: level_task_dict[level] - level_allocate_num_dict[level] for level in level_task_dict if level != max_level}\n",
    "remain_level_server_dict = {level: level_server_dict[level] - level_allocate_num_dict[level] for level in level_server_dict if level != max_level}\n",
    "\n",
    "max_level_allcate_num = {level: min(remain_level_task_dict[level], remain_level_server_dict[level])}\n",
    "\n",
    "for combination in itertools.product(range(max_level_allcate_num[max_level] + 1), repeat=non_max_levels_num):\n",
    "    level_allocate_num_dict = {level: allocate_num for level, allocate_num in zip(remain_level_task_dict.keys(), combination)}\n",
    "    level_allocate_num_dict[max_level] = max_level_allcate_num[max_level]\n",
    "\n",
    "    # 生成一个分配方案\n",
    "    distribution.append(tuple(level_allocate_num_dict[level] for level in level_task_dict.keys()))\n",
    "\n",
    "# 打印所有的分配方案\n",
    "for alloc in distribution:\n",
    "    print(alloc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 0, 0]\n",
      "[0, 1, 0]\n",
      "[0, 2, 0]\n",
      "[1, 0, 0]\n",
      "[1, 1, 0]\n",
      "[1, 2, 0]\n",
      "[2, 0, 0]\n",
      "[2, 1, 0]\n",
      "[2, 2, 0]\n"
     ]
    }
   ],
   "source": [
    "tasks = [2, 2, 11]\n",
    "servers = [3, 4, 1]\n",
    "levels = [1, 2, 3]\n",
    "results = []\n",
    "\n",
    "generate_allocations(0, tasks, servers, [], results)\n",
    "\n",
    "for allocation in results:\n",
    "    print(allocation)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[11, 2, 2]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reversed_tasks = reversed([2, 2, 11])\n",
    "# for i in reversed_tasks:\n",
    "#     print(i)\n",
    "list(reversed_tasks)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (916491982.py, line 57)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [1]\u001b[1;36m\u001b[0m\n\u001b[1;33m    to_allocated_server_num = servers[]\u001b[0m\n\u001b[1;37m                                      ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import itertools\n",
    "\n",
    "def find_not_zero_level_index(arr):\n",
    "    if arr[0] == 0:\n",
    "        return -1\n",
    "    \n",
    "    len_arr = len(arr)\n",
    "    for i in range(len_arr - 1):\n",
    "        if arr[i] != 0 and arr[i + 1] == 0:\n",
    "            return i\n",
    "\n",
    "    # 如果没有找到满足条件的数，则返回-1或其他合适的值\n",
    "    return len_arr\n",
    "def generate_combinations(choices, k):\n",
    "    if k == 0:\n",
    "        yield ()\n",
    "    else:\n",
    "        for i in range(len(choices)):\n",
    "            choice = choices[i]\n",
    "            rest = choices[i+1:]\n",
    "            for sub_comb in generate_combinations(rest, k-1):\n",
    "                yield (choice,) + sub_comb\n",
    "\n",
    "tasks =  [2, 2, 11]\n",
    "servers = [3, 4, 1]\n",
    "levels =  [1, 2, 3]\n",
    "\n",
    "\n",
    "choices = [11, 8, 6]\n",
    "k_values =[ 5, 4, 3]\n",
    "\n",
    "\n",
    "combinations = []\n",
    "reversed_tasks = list(reversed(tasks))\n",
    "reversed_servers = list(reversed(servers))\n",
    "reversed_levels = list(reversed(levels))\n",
    "decisions = []\n",
    "decision = []\n",
    "def allocate(tasks, servers, levels, decision = []):\n",
    "    # 当时最后一次分配\n",
    "    # 当\n",
    "    \n",
    "    decisions = []\n",
    "    last_task_level_idx = find_not_zero_level_index(tasks)\n",
    "    last_server_level_idx = find_not_zero_level_index(servers)\n",
    "    if last_server_level_idx==-1:\n",
    "        return None\n",
    "    if last_task_level_idx == last_server_level_idx:\n",
    "        # 分配最后一个非0 server给小于等于其level的task\n",
    "        last_level = levels[last_server_level_idx]\n",
    "        server_num = servers[last_server_level_idx]\n",
    "        task_num = tasks[last_server_level_idx]\n",
    "        # 任务等级，业务员等级，数量\n",
    "        decision.append((last_level, last_level, task_num))\n",
    "        remain_task_num = task_num - server_num\n",
    "        servers[last_server_level_idx] = 0\n",
    "        tasks[last_server_level_idx] = remain_task_num\n",
    "        decisions = decisions + allocate(tasks, servers, levels, decision)\n",
    "    elif last_task_level_idx > last_server_level_idx:\n",
    "        # 对一个servers 分到小于等于level的task里面\n",
    "        # 随机\n",
    "        # 筛选\n",
    "\n",
    "        allocate_ranges = [range(0, min(tasks[idx], servers[last_server_level_idx])) for idx in range(last_server_level_idx, last_task_level_idx+1)]\n",
    "        allocate_combinations = list(itertools.product(*allocate_ranges))\n",
    "        to_allocated_level = levels[last_server_level_idx]\n",
    "        to_allocated_server_num = servers[last_server_level_idx]\n",
    "        # 筛选小于to_allocated_server_num条件的随机组合\n",
    "        allocate_combinations_avalible = []\n",
    "        level_idx_idx = list(range(last_server_level_idx, last_task_level_idx+1))\n",
    "        for comb in allocate_combinations:\n",
    "            if sum(comb) == to_allocated_server_num:\n",
    "                a_decision = decision.copy()\n",
    "                a_servers = servers.copy()\n",
    "                a_tasks = tasks.copy()\n",
    "                for a_level_idx in level_idx_idx:\n",
    "                    if comb[a_level_idx]:\n",
    "                        a_level = levels[a_level_idx]\n",
    "                        servered_num = comb[a_level_idx]\n",
    "                        # 任务等级，业务员等级，数量\n",
    "                        a_decision.append(a_level, to_allocated_level, servered_num)\n",
    "                        task_num = tasks[a_level_idx]\n",
    "                        remain_task_num = task_num - servered_num\n",
    "                        a_servers[a_level_idx] = a_servers[a_level_idx] - servered_num\n",
    "                        a_tasks[a_level_idx] = remain_task_num\n",
    "\n",
    "                decisions += allocate(a_tasks, a_servers, levels, a_decision)\n",
    "        # 对每个comb都做递归的添加，先求得分配之后的情况，对每种情况做分配\n",
    "    else:\n",
    "        print(f\"error in tasks, servers, levels{tasks, servers, levels}\")\n",
    "\n",
    "    return decisions\n",
    "\n",
    "\n",
    "\n",
    "for idx, (task_num, server_num, level) in enumerate(zip(reversed_tasks, reversed_servers, reversed_levels)):\n",
    "    # 从后往前开始分配，先分配最小的\n",
    "    decision.append(())\n",
    "    choices_range = range(choice+1)\n",
    "    choices_combinations = list(generate_combinations(choices_range, k))\n",
    "    combinations.append(choices_combinations)\n",
    "\n",
    "final_combinations = list(itertools.product(*combinations))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "last_task_level_idx = find_not_zero_level_index(tasks)\n",
    "last_server_level_idx = find_not_zero_level_index(servers)\n",
    "# 分配最后一个非0 server给小于等于其level的task\n",
    "last_level = levels[last_server_level_idx]\n",
    "server_num = servers[last_server_level_idx]\n",
    "task_num = tasks[last_server_level_idx]\n",
    "# 任务等级，业务员等级，数量\n",
    "decision.append((last_level, last_level, task_num))\n",
    "remain_task_num = task_num - server_num\n",
    "servers[last_server_level_idx] = 0\n",
    "tasks[last_server_level_idx] -= server_num\n",
    "last_task_level_idx = find_not_zero_level_index(tasks)\n",
    "last_server_level_idx = find_not_zero_level_index(servers)\n",
    "for server_idx in range(last_server_level_idx, -1, -1):\n",
    "\n",
    "    allocate_ranges = [range(0, min(tasks[idx], servers[last_server_level_idx])) for idx in range(last_server_level_idx, last_task_level_idx+1)]\n",
    "    allocate_combinations = list(itertools.product(*allocate_ranges))\n",
    "    to_allocated_level = levels[last_server_level_idx]\n",
    "    to_allocated_server_num = servers[last_server_level_idx]\n",
    "    # 筛选小于to_allocated_server_num条件的随机组合\n",
    "    allocate_combinations_avalible = []\n",
    "    for comb in allocate_combinations:\n",
    "        if sum(comb) == to_allocated_server_num:\n",
    "            # 合适的comb\n",
    "            a_decision = []\n",
    "            for idx in range(last_server_level_idx, last_task_level_idx+1):\n",
    "                if comb[idx]:\n",
    "                    a_decision.append(idx, to_allocated_level, comb[idx])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[(0, 1, 2, 3, 4),\n",
       "  (0, 1, 2, 3, 5),\n",
       "  (0, 1, 2, 3, 6),\n",
       "  (0, 1, 2, 3, 7),\n",
       "  (0, 1, 2, 3, 8),\n",
       "  (0, 1, 2, 3, 9),\n",
       "  (0, 1, 2, 3, 10),\n",
       "  (0, 1, 2, 3, 11),\n",
       "  (0, 1, 2, 4, 5),\n",
       "  (0, 1, 2, 4, 6),\n",
       "  (0, 1, 2, 4, 7),\n",
       "  (0, 1, 2, 4, 8),\n",
       "  (0, 1, 2, 4, 9),\n",
       "  (0, 1, 2, 4, 10),\n",
       "  (0, 1, 2, 4, 11),\n",
       "  (0, 1, 2, 5, 6),\n",
       "  (0, 1, 2, 5, 7),\n",
       "  (0, 1, 2, 5, 8),\n",
       "  (0, 1, 2, 5, 9),\n",
       "  (0, 1, 2, 5, 10),\n",
       "  (0, 1, 2, 5, 11),\n",
       "  (0, 1, 2, 6, 7),\n",
       "  (0, 1, 2, 6, 8),\n",
       "  (0, 1, 2, 6, 9),\n",
       "  (0, 1, 2, 6, 10),\n",
       "  (0, 1, 2, 6, 11),\n",
       "  (0, 1, 2, 7, 8),\n",
       "  (0, 1, 2, 7, 9),\n",
       "  (0, 1, 2, 7, 10),\n",
       "  (0, 1, 2, 7, 11),\n",
       "  (0, 1, 2, 8, 9),\n",
       "  (0, 1, 2, 8, 10),\n",
       "  (0, 1, 2, 8, 11),\n",
       "  (0, 1, 2, 9, 10),\n",
       "  (0, 1, 2, 9, 11),\n",
       "  (0, 1, 2, 10, 11),\n",
       "  (0, 1, 3, 4, 5),\n",
       "  (0, 1, 3, 4, 6),\n",
       "  (0, 1, 3, 4, 7),\n",
       "  (0, 1, 3, 4, 8),\n",
       "  (0, 1, 3, 4, 9),\n",
       "  (0, 1, 3, 4, 10),\n",
       "  (0, 1, 3, 4, 11),\n",
       "  (0, 1, 3, 5, 6),\n",
       "  (0, 1, 3, 5, 7),\n",
       "  (0, 1, 3, 5, 8),\n",
       "  (0, 1, 3, 5, 9),\n",
       "  (0, 1, 3, 5, 10),\n",
       "  (0, 1, 3, 5, 11),\n",
       "  (0, 1, 3, 6, 7),\n",
       "  (0, 1, 3, 6, 8),\n",
       "  (0, 1, 3, 6, 9),\n",
       "  (0, 1, 3, 6, 10),\n",
       "  (0, 1, 3, 6, 11),\n",
       "  (0, 1, 3, 7, 8),\n",
       "  (0, 1, 3, 7, 9),\n",
       "  (0, 1, 3, 7, 10),\n",
       "  (0, 1, 3, 7, 11),\n",
       "  (0, 1, 3, 8, 9),\n",
       "  (0, 1, 3, 8, 10),\n",
       "  (0, 1, 3, 8, 11),\n",
       "  (0, 1, 3, 9, 10),\n",
       "  (0, 1, 3, 9, 11),\n",
       "  (0, 1, 3, 10, 11),\n",
       "  (0, 1, 4, 5, 6),\n",
       "  (0, 1, 4, 5, 7),\n",
       "  (0, 1, 4, 5, 8),\n",
       "  (0, 1, 4, 5, 9),\n",
       "  (0, 1, 4, 5, 10),\n",
       "  (0, 1, 4, 5, 11),\n",
       "  (0, 1, 4, 6, 7),\n",
       "  (0, 1, 4, 6, 8),\n",
       "  (0, 1, 4, 6, 9),\n",
       "  (0, 1, 4, 6, 10),\n",
       "  (0, 1, 4, 6, 11),\n",
       "  (0, 1, 4, 7, 8),\n",
       "  (0, 1, 4, 7, 9),\n",
       "  (0, 1, 4, 7, 10),\n",
       "  (0, 1, 4, 7, 11),\n",
       "  (0, 1, 4, 8, 9),\n",
       "  (0, 1, 4, 8, 10),\n",
       "  (0, 1, 4, 8, 11),\n",
       "  (0, 1, 4, 9, 10),\n",
       "  (0, 1, 4, 9, 11),\n",
       "  (0, 1, 4, 10, 11),\n",
       "  (0, 1, 5, 6, 7),\n",
       "  (0, 1, 5, 6, 8),\n",
       "  (0, 1, 5, 6, 9),\n",
       "  (0, 1, 5, 6, 10),\n",
       "  (0, 1, 5, 6, 11),\n",
       "  (0, 1, 5, 7, 8),\n",
       "  (0, 1, 5, 7, 9),\n",
       "  (0, 1, 5, 7, 10),\n",
       "  (0, 1, 5, 7, 11),\n",
       "  (0, 1, 5, 8, 9),\n",
       "  (0, 1, 5, 8, 10),\n",
       "  (0, 1, 5, 8, 11),\n",
       "  (0, 1, 5, 9, 10),\n",
       "  (0, 1, 5, 9, 11),\n",
       "  (0, 1, 5, 10, 11),\n",
       "  (0, 1, 6, 7, 8),\n",
       "  (0, 1, 6, 7, 9),\n",
       "  (0, 1, 6, 7, 10),\n",
       "  (0, 1, 6, 7, 11),\n",
       "  (0, 1, 6, 8, 9),\n",
       "  (0, 1, 6, 8, 10),\n",
       "  (0, 1, 6, 8, 11),\n",
       "  (0, 1, 6, 9, 10),\n",
       "  (0, 1, 6, 9, 11),\n",
       "  (0, 1, 6, 10, 11),\n",
       "  (0, 1, 7, 8, 9),\n",
       "  (0, 1, 7, 8, 10),\n",
       "  (0, 1, 7, 8, 11),\n",
       "  (0, 1, 7, 9, 10),\n",
       "  (0, 1, 7, 9, 11),\n",
       "  (0, 1, 7, 10, 11),\n",
       "  (0, 1, 8, 9, 10),\n",
       "  (0, 1, 8, 9, 11),\n",
       "  (0, 1, 8, 10, 11),\n",
       "  (0, 1, 9, 10, 11),\n",
       "  (0, 2, 3, 4, 5),\n",
       "  (0, 2, 3, 4, 6),\n",
       "  (0, 2, 3, 4, 7),\n",
       "  (0, 2, 3, 4, 8),\n",
       "  (0, 2, 3, 4, 9),\n",
       "  (0, 2, 3, 4, 10),\n",
       "  (0, 2, 3, 4, 11),\n",
       "  (0, 2, 3, 5, 6),\n",
       "  (0, 2, 3, 5, 7),\n",
       "  (0, 2, 3, 5, 8),\n",
       "  (0, 2, 3, 5, 9),\n",
       "  (0, 2, 3, 5, 10),\n",
       "  (0, 2, 3, 5, 11),\n",
       "  (0, 2, 3, 6, 7),\n",
       "  (0, 2, 3, 6, 8),\n",
       "  (0, 2, 3, 6, 9),\n",
       "  (0, 2, 3, 6, 10),\n",
       "  (0, 2, 3, 6, 11),\n",
       "  (0, 2, 3, 7, 8),\n",
       "  (0, 2, 3, 7, 9),\n",
       "  (0, 2, 3, 7, 10),\n",
       "  (0, 2, 3, 7, 11),\n",
       "  (0, 2, 3, 8, 9),\n",
       "  (0, 2, 3, 8, 10),\n",
       "  (0, 2, 3, 8, 11),\n",
       "  (0, 2, 3, 9, 10),\n",
       "  (0, 2, 3, 9, 11),\n",
       "  (0, 2, 3, 10, 11),\n",
       "  (0, 2, 4, 5, 6),\n",
       "  (0, 2, 4, 5, 7),\n",
       "  (0, 2, 4, 5, 8),\n",
       "  (0, 2, 4, 5, 9),\n",
       "  (0, 2, 4, 5, 10),\n",
       "  (0, 2, 4, 5, 11),\n",
       "  (0, 2, 4, 6, 7),\n",
       "  (0, 2, 4, 6, 8),\n",
       "  (0, 2, 4, 6, 9),\n",
       "  (0, 2, 4, 6, 10),\n",
       "  (0, 2, 4, 6, 11),\n",
       "  (0, 2, 4, 7, 8),\n",
       "  (0, 2, 4, 7, 9),\n",
       "  (0, 2, 4, 7, 10),\n",
       "  (0, 2, 4, 7, 11),\n",
       "  (0, 2, 4, 8, 9),\n",
       "  (0, 2, 4, 8, 10),\n",
       "  (0, 2, 4, 8, 11),\n",
       "  (0, 2, 4, 9, 10),\n",
       "  (0, 2, 4, 9, 11),\n",
       "  (0, 2, 4, 10, 11),\n",
       "  (0, 2, 5, 6, 7),\n",
       "  (0, 2, 5, 6, 8),\n",
       "  (0, 2, 5, 6, 9),\n",
       "  (0, 2, 5, 6, 10),\n",
       "  (0, 2, 5, 6, 11),\n",
       "  (0, 2, 5, 7, 8),\n",
       "  (0, 2, 5, 7, 9),\n",
       "  (0, 2, 5, 7, 10),\n",
       "  (0, 2, 5, 7, 11),\n",
       "  (0, 2, 5, 8, 9),\n",
       "  (0, 2, 5, 8, 10),\n",
       "  (0, 2, 5, 8, 11),\n",
       "  (0, 2, 5, 9, 10),\n",
       "  (0, 2, 5, 9, 11),\n",
       "  (0, 2, 5, 10, 11),\n",
       "  (0, 2, 6, 7, 8),\n",
       "  (0, 2, 6, 7, 9),\n",
       "  (0, 2, 6, 7, 10),\n",
       "  (0, 2, 6, 7, 11),\n",
       "  (0, 2, 6, 8, 9),\n",
       "  (0, 2, 6, 8, 10),\n",
       "  (0, 2, 6, 8, 11),\n",
       "  (0, 2, 6, 9, 10),\n",
       "  (0, 2, 6, 9, 11),\n",
       "  (0, 2, 6, 10, 11),\n",
       "  (0, 2, 7, 8, 9),\n",
       "  (0, 2, 7, 8, 10),\n",
       "  (0, 2, 7, 8, 11),\n",
       "  (0, 2, 7, 9, 10),\n",
       "  (0, 2, 7, 9, 11),\n",
       "  (0, 2, 7, 10, 11),\n",
       "  (0, 2, 8, 9, 10),\n",
       "  (0, 2, 8, 9, 11),\n",
       "  (0, 2, 8, 10, 11),\n",
       "  (0, 2, 9, 10, 11),\n",
       "  (0, 3, 4, 5, 6),\n",
       "  (0, 3, 4, 5, 7),\n",
       "  (0, 3, 4, 5, 8),\n",
       "  (0, 3, 4, 5, 9),\n",
       "  (0, 3, 4, 5, 10),\n",
       "  (0, 3, 4, 5, 11),\n",
       "  (0, 3, 4, 6, 7),\n",
       "  (0, 3, 4, 6, 8),\n",
       "  (0, 3, 4, 6, 9),\n",
       "  (0, 3, 4, 6, 10),\n",
       "  (0, 3, 4, 6, 11),\n",
       "  (0, 3, 4, 7, 8),\n",
       "  (0, 3, 4, 7, 9),\n",
       "  (0, 3, 4, 7, 10),\n",
       "  (0, 3, 4, 7, 11),\n",
       "  (0, 3, 4, 8, 9),\n",
       "  (0, 3, 4, 8, 10),\n",
       "  (0, 3, 4, 8, 11),\n",
       "  (0, 3, 4, 9, 10),\n",
       "  (0, 3, 4, 9, 11),\n",
       "  (0, 3, 4, 10, 11),\n",
       "  (0, 3, 5, 6, 7),\n",
       "  (0, 3, 5, 6, 8),\n",
       "  (0, 3, 5, 6, 9),\n",
       "  (0, 3, 5, 6, 10),\n",
       "  (0, 3, 5, 6, 11),\n",
       "  (0, 3, 5, 7, 8),\n",
       "  (0, 3, 5, 7, 9),\n",
       "  (0, 3, 5, 7, 10),\n",
       "  (0, 3, 5, 7, 11),\n",
       "  (0, 3, 5, 8, 9),\n",
       "  (0, 3, 5, 8, 10),\n",
       "  (0, 3, 5, 8, 11),\n",
       "  (0, 3, 5, 9, 10),\n",
       "  (0, 3, 5, 9, 11),\n",
       "  (0, 3, 5, 10, 11),\n",
       "  (0, 3, 6, 7, 8),\n",
       "  (0, 3, 6, 7, 9),\n",
       "  (0, 3, 6, 7, 10),\n",
       "  (0, 3, 6, 7, 11),\n",
       "  (0, 3, 6, 8, 9),\n",
       "  (0, 3, 6, 8, 10),\n",
       "  (0, 3, 6, 8, 11),\n",
       "  (0, 3, 6, 9, 10),\n",
       "  (0, 3, 6, 9, 11),\n",
       "  (0, 3, 6, 10, 11),\n",
       "  (0, 3, 7, 8, 9),\n",
       "  (0, 3, 7, 8, 10),\n",
       "  (0, 3, 7, 8, 11),\n",
       "  (0, 3, 7, 9, 10),\n",
       "  (0, 3, 7, 9, 11),\n",
       "  (0, 3, 7, 10, 11),\n",
       "  (0, 3, 8, 9, 10),\n",
       "  (0, 3, 8, 9, 11),\n",
       "  (0, 3, 8, 10, 11),\n",
       "  (0, 3, 9, 10, 11),\n",
       "  (0, 4, 5, 6, 7),\n",
       "  (0, 4, 5, 6, 8),\n",
       "  (0, 4, 5, 6, 9),\n",
       "  (0, 4, 5, 6, 10),\n",
       "  (0, 4, 5, 6, 11),\n",
       "  (0, 4, 5, 7, 8),\n",
       "  (0, 4, 5, 7, 9),\n",
       "  (0, 4, 5, 7, 10),\n",
       "  (0, 4, 5, 7, 11),\n",
       "  (0, 4, 5, 8, 9),\n",
       "  (0, 4, 5, 8, 10),\n",
       "  (0, 4, 5, 8, 11),\n",
       "  (0, 4, 5, 9, 10),\n",
       "  (0, 4, 5, 9, 11),\n",
       "  (0, 4, 5, 10, 11),\n",
       "  (0, 4, 6, 7, 8),\n",
       "  (0, 4, 6, 7, 9),\n",
       "  (0, 4, 6, 7, 10),\n",
       "  (0, 4, 6, 7, 11),\n",
       "  (0, 4, 6, 8, 9),\n",
       "  (0, 4, 6, 8, 10),\n",
       "  (0, 4, 6, 8, 11),\n",
       "  (0, 4, 6, 9, 10),\n",
       "  (0, 4, 6, 9, 11),\n",
       "  (0, 4, 6, 10, 11),\n",
       "  (0, 4, 7, 8, 9),\n",
       "  (0, 4, 7, 8, 10),\n",
       "  (0, 4, 7, 8, 11),\n",
       "  (0, 4, 7, 9, 10),\n",
       "  (0, 4, 7, 9, 11),\n",
       "  (0, 4, 7, 10, 11),\n",
       "  (0, 4, 8, 9, 10),\n",
       "  (0, 4, 8, 9, 11),\n",
       "  (0, 4, 8, 10, 11),\n",
       "  (0, 4, 9, 10, 11),\n",
       "  (0, 5, 6, 7, 8),\n",
       "  (0, 5, 6, 7, 9),\n",
       "  (0, 5, 6, 7, 10),\n",
       "  (0, 5, 6, 7, 11),\n",
       "  (0, 5, 6, 8, 9),\n",
       "  (0, 5, 6, 8, 10),\n",
       "  (0, 5, 6, 8, 11),\n",
       "  (0, 5, 6, 9, 10),\n",
       "  (0, 5, 6, 9, 11),\n",
       "  (0, 5, 6, 10, 11),\n",
       "  (0, 5, 7, 8, 9),\n",
       "  (0, 5, 7, 8, 10),\n",
       "  (0, 5, 7, 8, 11),\n",
       "  (0, 5, 7, 9, 10),\n",
       "  (0, 5, 7, 9, 11),\n",
       "  (0, 5, 7, 10, 11),\n",
       "  (0, 5, 8, 9, 10),\n",
       "  (0, 5, 8, 9, 11),\n",
       "  (0, 5, 8, 10, 11),\n",
       "  (0, 5, 9, 10, 11),\n",
       "  (0, 6, 7, 8, 9),\n",
       "  (0, 6, 7, 8, 10),\n",
       "  (0, 6, 7, 8, 11),\n",
       "  (0, 6, 7, 9, 10),\n",
       "  (0, 6, 7, 9, 11),\n",
       "  (0, 6, 7, 10, 11),\n",
       "  (0, 6, 8, 9, 10),\n",
       "  (0, 6, 8, 9, 11),\n",
       "  (0, 6, 8, 10, 11),\n",
       "  (0, 6, 9, 10, 11),\n",
       "  (0, 7, 8, 9, 10),\n",
       "  (0, 7, 8, 9, 11),\n",
       "  (0, 7, 8, 10, 11),\n",
       "  (0, 7, 9, 10, 11),\n",
       "  (0, 8, 9, 10, 11),\n",
       "  (1, 2, 3, 4, 5),\n",
       "  (1, 2, 3, 4, 6),\n",
       "  (1, 2, 3, 4, 7),\n",
       "  (1, 2, 3, 4, 8),\n",
       "  (1, 2, 3, 4, 9),\n",
       "  (1, 2, 3, 4, 10),\n",
       "  (1, 2, 3, 4, 11),\n",
       "  (1, 2, 3, 5, 6),\n",
       "  (1, 2, 3, 5, 7),\n",
       "  (1, 2, 3, 5, 8),\n",
       "  (1, 2, 3, 5, 9),\n",
       "  (1, 2, 3, 5, 10),\n",
       "  (1, 2, 3, 5, 11),\n",
       "  (1, 2, 3, 6, 7),\n",
       "  (1, 2, 3, 6, 8),\n",
       "  (1, 2, 3, 6, 9),\n",
       "  (1, 2, 3, 6, 10),\n",
       "  (1, 2, 3, 6, 11),\n",
       "  (1, 2, 3, 7, 8),\n",
       "  (1, 2, 3, 7, 9),\n",
       "  (1, 2, 3, 7, 10),\n",
       "  (1, 2, 3, 7, 11),\n",
       "  (1, 2, 3, 8, 9),\n",
       "  (1, 2, 3, 8, 10),\n",
       "  (1, 2, 3, 8, 11),\n",
       "  (1, 2, 3, 9, 10),\n",
       "  (1, 2, 3, 9, 11),\n",
       "  (1, 2, 3, 10, 11),\n",
       "  (1, 2, 4, 5, 6),\n",
       "  (1, 2, 4, 5, 7),\n",
       "  (1, 2, 4, 5, 8),\n",
       "  (1, 2, 4, 5, 9),\n",
       "  (1, 2, 4, 5, 10),\n",
       "  (1, 2, 4, 5, 11),\n",
       "  (1, 2, 4, 6, 7),\n",
       "  (1, 2, 4, 6, 8),\n",
       "  (1, 2, 4, 6, 9),\n",
       "  (1, 2, 4, 6, 10),\n",
       "  (1, 2, 4, 6, 11),\n",
       "  (1, 2, 4, 7, 8),\n",
       "  (1, 2, 4, 7, 9),\n",
       "  (1, 2, 4, 7, 10),\n",
       "  (1, 2, 4, 7, 11),\n",
       "  (1, 2, 4, 8, 9),\n",
       "  (1, 2, 4, 8, 10),\n",
       "  (1, 2, 4, 8, 11),\n",
       "  (1, 2, 4, 9, 10),\n",
       "  (1, 2, 4, 9, 11),\n",
       "  (1, 2, 4, 10, 11),\n",
       "  (1, 2, 5, 6, 7),\n",
       "  (1, 2, 5, 6, 8),\n",
       "  (1, 2, 5, 6, 9),\n",
       "  (1, 2, 5, 6, 10),\n",
       "  (1, 2, 5, 6, 11),\n",
       "  (1, 2, 5, 7, 8),\n",
       "  (1, 2, 5, 7, 9),\n",
       "  (1, 2, 5, 7, 10),\n",
       "  (1, 2, 5, 7, 11),\n",
       "  (1, 2, 5, 8, 9),\n",
       "  (1, 2, 5, 8, 10),\n",
       "  (1, 2, 5, 8, 11),\n",
       "  (1, 2, 5, 9, 10),\n",
       "  (1, 2, 5, 9, 11),\n",
       "  (1, 2, 5, 10, 11),\n",
       "  (1, 2, 6, 7, 8),\n",
       "  (1, 2, 6, 7, 9),\n",
       "  (1, 2, 6, 7, 10),\n",
       "  (1, 2, 6, 7, 11),\n",
       "  (1, 2, 6, 8, 9),\n",
       "  (1, 2, 6, 8, 10),\n",
       "  (1, 2, 6, 8, 11),\n",
       "  (1, 2, 6, 9, 10),\n",
       "  (1, 2, 6, 9, 11),\n",
       "  (1, 2, 6, 10, 11),\n",
       "  (1, 2, 7, 8, 9),\n",
       "  (1, 2, 7, 8, 10),\n",
       "  (1, 2, 7, 8, 11),\n",
       "  (1, 2, 7, 9, 10),\n",
       "  (1, 2, 7, 9, 11),\n",
       "  (1, 2, 7, 10, 11),\n",
       "  (1, 2, 8, 9, 10),\n",
       "  (1, 2, 8, 9, 11),\n",
       "  (1, 2, 8, 10, 11),\n",
       "  (1, 2, 9, 10, 11),\n",
       "  (1, 3, 4, 5, 6),\n",
       "  (1, 3, 4, 5, 7),\n",
       "  (1, 3, 4, 5, 8),\n",
       "  (1, 3, 4, 5, 9),\n",
       "  (1, 3, 4, 5, 10),\n",
       "  (1, 3, 4, 5, 11),\n",
       "  (1, 3, 4, 6, 7),\n",
       "  (1, 3, 4, 6, 8),\n",
       "  (1, 3, 4, 6, 9),\n",
       "  (1, 3, 4, 6, 10),\n",
       "  (1, 3, 4, 6, 11),\n",
       "  (1, 3, 4, 7, 8),\n",
       "  (1, 3, 4, 7, 9),\n",
       "  (1, 3, 4, 7, 10),\n",
       "  (1, 3, 4, 7, 11),\n",
       "  (1, 3, 4, 8, 9),\n",
       "  (1, 3, 4, 8, 10),\n",
       "  (1, 3, 4, 8, 11),\n",
       "  (1, 3, 4, 9, 10),\n",
       "  (1, 3, 4, 9, 11),\n",
       "  (1, 3, 4, 10, 11),\n",
       "  (1, 3, 5, 6, 7),\n",
       "  (1, 3, 5, 6, 8),\n",
       "  (1, 3, 5, 6, 9),\n",
       "  (1, 3, 5, 6, 10),\n",
       "  (1, 3, 5, 6, 11),\n",
       "  (1, 3, 5, 7, 8),\n",
       "  (1, 3, 5, 7, 9),\n",
       "  (1, 3, 5, 7, 10),\n",
       "  (1, 3, 5, 7, 11),\n",
       "  (1, 3, 5, 8, 9),\n",
       "  (1, 3, 5, 8, 10),\n",
       "  (1, 3, 5, 8, 11),\n",
       "  (1, 3, 5, 9, 10),\n",
       "  (1, 3, 5, 9, 11),\n",
       "  (1, 3, 5, 10, 11),\n",
       "  (1, 3, 6, 7, 8),\n",
       "  (1, 3, 6, 7, 9),\n",
       "  (1, 3, 6, 7, 10),\n",
       "  (1, 3, 6, 7, 11),\n",
       "  (1, 3, 6, 8, 9),\n",
       "  (1, 3, 6, 8, 10),\n",
       "  (1, 3, 6, 8, 11),\n",
       "  (1, 3, 6, 9, 10),\n",
       "  (1, 3, 6, 9, 11),\n",
       "  (1, 3, 6, 10, 11),\n",
       "  (1, 3, 7, 8, 9),\n",
       "  (1, 3, 7, 8, 10),\n",
       "  (1, 3, 7, 8, 11),\n",
       "  (1, 3, 7, 9, 10),\n",
       "  (1, 3, 7, 9, 11),\n",
       "  (1, 3, 7, 10, 11),\n",
       "  (1, 3, 8, 9, 10),\n",
       "  (1, 3, 8, 9, 11),\n",
       "  (1, 3, 8, 10, 11),\n",
       "  (1, 3, 9, 10, 11),\n",
       "  (1, 4, 5, 6, 7),\n",
       "  (1, 4, 5, 6, 8),\n",
       "  (1, 4, 5, 6, 9),\n",
       "  (1, 4, 5, 6, 10),\n",
       "  (1, 4, 5, 6, 11),\n",
       "  (1, 4, 5, 7, 8),\n",
       "  (1, 4, 5, 7, 9),\n",
       "  (1, 4, 5, 7, 10),\n",
       "  (1, 4, 5, 7, 11),\n",
       "  (1, 4, 5, 8, 9),\n",
       "  (1, 4, 5, 8, 10),\n",
       "  (1, 4, 5, 8, 11),\n",
       "  (1, 4, 5, 9, 10),\n",
       "  (1, 4, 5, 9, 11),\n",
       "  (1, 4, 5, 10, 11),\n",
       "  (1, 4, 6, 7, 8),\n",
       "  (1, 4, 6, 7, 9),\n",
       "  (1, 4, 6, 7, 10),\n",
       "  (1, 4, 6, 7, 11),\n",
       "  (1, 4, 6, 8, 9),\n",
       "  (1, 4, 6, 8, 10),\n",
       "  (1, 4, 6, 8, 11),\n",
       "  (1, 4, 6, 9, 10),\n",
       "  (1, 4, 6, 9, 11),\n",
       "  (1, 4, 6, 10, 11),\n",
       "  (1, 4, 7, 8, 9),\n",
       "  (1, 4, 7, 8, 10),\n",
       "  (1, 4, 7, 8, 11),\n",
       "  (1, 4, 7, 9, 10),\n",
       "  (1, 4, 7, 9, 11),\n",
       "  (1, 4, 7, 10, 11),\n",
       "  (1, 4, 8, 9, 10),\n",
       "  (1, 4, 8, 9, 11),\n",
       "  (1, 4, 8, 10, 11),\n",
       "  (1, 4, 9, 10, 11),\n",
       "  (1, 5, 6, 7, 8),\n",
       "  (1, 5, 6, 7, 9),\n",
       "  (1, 5, 6, 7, 10),\n",
       "  (1, 5, 6, 7, 11),\n",
       "  (1, 5, 6, 8, 9),\n",
       "  (1, 5, 6, 8, 10),\n",
       "  (1, 5, 6, 8, 11),\n",
       "  (1, 5, 6, 9, 10),\n",
       "  (1, 5, 6, 9, 11),\n",
       "  (1, 5, 6, 10, 11),\n",
       "  (1, 5, 7, 8, 9),\n",
       "  (1, 5, 7, 8, 10),\n",
       "  (1, 5, 7, 8, 11),\n",
       "  (1, 5, 7, 9, 10),\n",
       "  (1, 5, 7, 9, 11),\n",
       "  (1, 5, 7, 10, 11),\n",
       "  (1, 5, 8, 9, 10),\n",
       "  (1, 5, 8, 9, 11),\n",
       "  (1, 5, 8, 10, 11),\n",
       "  (1, 5, 9, 10, 11),\n",
       "  (1, 6, 7, 8, 9),\n",
       "  (1, 6, 7, 8, 10),\n",
       "  (1, 6, 7, 8, 11),\n",
       "  (1, 6, 7, 9, 10),\n",
       "  (1, 6, 7, 9, 11),\n",
       "  (1, 6, 7, 10, 11),\n",
       "  (1, 6, 8, 9, 10),\n",
       "  (1, 6, 8, 9, 11),\n",
       "  (1, 6, 8, 10, 11),\n",
       "  (1, 6, 9, 10, 11),\n",
       "  (1, 7, 8, 9, 10),\n",
       "  (1, 7, 8, 9, 11),\n",
       "  (1, 7, 8, 10, 11),\n",
       "  (1, 7, 9, 10, 11),\n",
       "  (1, 8, 9, 10, 11),\n",
       "  (2, 3, 4, 5, 6),\n",
       "  (2, 3, 4, 5, 7),\n",
       "  (2, 3, 4, 5, 8),\n",
       "  (2, 3, 4, 5, 9),\n",
       "  (2, 3, 4, 5, 10),\n",
       "  (2, 3, 4, 5, 11),\n",
       "  (2, 3, 4, 6, 7),\n",
       "  (2, 3, 4, 6, 8),\n",
       "  (2, 3, 4, 6, 9),\n",
       "  (2, 3, 4, 6, 10),\n",
       "  (2, 3, 4, 6, 11),\n",
       "  (2, 3, 4, 7, 8),\n",
       "  (2, 3, 4, 7, 9),\n",
       "  (2, 3, 4, 7, 10),\n",
       "  (2, 3, 4, 7, 11),\n",
       "  (2, 3, 4, 8, 9),\n",
       "  (2, 3, 4, 8, 10),\n",
       "  (2, 3, 4, 8, 11),\n",
       "  (2, 3, 4, 9, 10),\n",
       "  (2, 3, 4, 9, 11),\n",
       "  (2, 3, 4, 10, 11),\n",
       "  (2, 3, 5, 6, 7),\n",
       "  (2, 3, 5, 6, 8),\n",
       "  (2, 3, 5, 6, 9),\n",
       "  (2, 3, 5, 6, 10),\n",
       "  (2, 3, 5, 6, 11),\n",
       "  (2, 3, 5, 7, 8),\n",
       "  (2, 3, 5, 7, 9),\n",
       "  (2, 3, 5, 7, 10),\n",
       "  (2, 3, 5, 7, 11),\n",
       "  (2, 3, 5, 8, 9),\n",
       "  (2, 3, 5, 8, 10),\n",
       "  (2, 3, 5, 8, 11),\n",
       "  (2, 3, 5, 9, 10),\n",
       "  (2, 3, 5, 9, 11),\n",
       "  (2, 3, 5, 10, 11),\n",
       "  (2, 3, 6, 7, 8),\n",
       "  (2, 3, 6, 7, 9),\n",
       "  (2, 3, 6, 7, 10),\n",
       "  (2, 3, 6, 7, 11),\n",
       "  (2, 3, 6, 8, 9),\n",
       "  (2, 3, 6, 8, 10),\n",
       "  (2, 3, 6, 8, 11),\n",
       "  (2, 3, 6, 9, 10),\n",
       "  (2, 3, 6, 9, 11),\n",
       "  (2, 3, 6, 10, 11),\n",
       "  (2, 3, 7, 8, 9),\n",
       "  (2, 3, 7, 8, 10),\n",
       "  (2, 3, 7, 8, 11),\n",
       "  (2, 3, 7, 9, 10),\n",
       "  (2, 3, 7, 9, 11),\n",
       "  (2, 3, 7, 10, 11),\n",
       "  (2, 3, 8, 9, 10),\n",
       "  (2, 3, 8, 9, 11),\n",
       "  (2, 3, 8, 10, 11),\n",
       "  (2, 3, 9, 10, 11),\n",
       "  (2, 4, 5, 6, 7),\n",
       "  (2, 4, 5, 6, 8),\n",
       "  (2, 4, 5, 6, 9),\n",
       "  (2, 4, 5, 6, 10),\n",
       "  (2, 4, 5, 6, 11),\n",
       "  (2, 4, 5, 7, 8),\n",
       "  (2, 4, 5, 7, 9),\n",
       "  (2, 4, 5, 7, 10),\n",
       "  (2, 4, 5, 7, 11),\n",
       "  (2, 4, 5, 8, 9),\n",
       "  (2, 4, 5, 8, 10),\n",
       "  (2, 4, 5, 8, 11),\n",
       "  (2, 4, 5, 9, 10),\n",
       "  (2, 4, 5, 9, 11),\n",
       "  (2, 4, 5, 10, 11),\n",
       "  (2, 4, 6, 7, 8),\n",
       "  (2, 4, 6, 7, 9),\n",
       "  (2, 4, 6, 7, 10),\n",
       "  (2, 4, 6, 7, 11),\n",
       "  (2, 4, 6, 8, 9),\n",
       "  (2, 4, 6, 8, 10),\n",
       "  (2, 4, 6, 8, 11),\n",
       "  (2, 4, 6, 9, 10),\n",
       "  (2, 4, 6, 9, 11),\n",
       "  (2, 4, 6, 10, 11),\n",
       "  (2, 4, 7, 8, 9),\n",
       "  (2, 4, 7, 8, 10),\n",
       "  (2, 4, 7, 8, 11),\n",
       "  (2, 4, 7, 9, 10),\n",
       "  (2, 4, 7, 9, 11),\n",
       "  (2, 4, 7, 10, 11),\n",
       "  (2, 4, 8, 9, 10),\n",
       "  (2, 4, 8, 9, 11),\n",
       "  (2, 4, 8, 10, 11),\n",
       "  (2, 4, 9, 10, 11),\n",
       "  (2, 5, 6, 7, 8),\n",
       "  (2, 5, 6, 7, 9),\n",
       "  (2, 5, 6, 7, 10),\n",
       "  (2, 5, 6, 7, 11),\n",
       "  (2, 5, 6, 8, 9),\n",
       "  (2, 5, 6, 8, 10),\n",
       "  (2, 5, 6, 8, 11),\n",
       "  (2, 5, 6, 9, 10),\n",
       "  (2, 5, 6, 9, 11),\n",
       "  (2, 5, 6, 10, 11),\n",
       "  (2, 5, 7, 8, 9),\n",
       "  (2, 5, 7, 8, 10),\n",
       "  (2, 5, 7, 8, 11),\n",
       "  (2, 5, 7, 9, 10),\n",
       "  (2, 5, 7, 9, 11),\n",
       "  (2, 5, 7, 10, 11),\n",
       "  (2, 5, 8, 9, 10),\n",
       "  (2, 5, 8, 9, 11),\n",
       "  (2, 5, 8, 10, 11),\n",
       "  (2, 5, 9, 10, 11),\n",
       "  (2, 6, 7, 8, 9),\n",
       "  (2, 6, 7, 8, 10),\n",
       "  (2, 6, 7, 8, 11),\n",
       "  (2, 6, 7, 9, 10),\n",
       "  (2, 6, 7, 9, 11),\n",
       "  (2, 6, 7, 10, 11),\n",
       "  (2, 6, 8, 9, 10),\n",
       "  (2, 6, 8, 9, 11),\n",
       "  (2, 6, 8, 10, 11),\n",
       "  (2, 6, 9, 10, 11),\n",
       "  (2, 7, 8, 9, 10),\n",
       "  (2, 7, 8, 9, 11),\n",
       "  (2, 7, 8, 10, 11),\n",
       "  (2, 7, 9, 10, 11),\n",
       "  (2, 8, 9, 10, 11),\n",
       "  (3, 4, 5, 6, 7),\n",
       "  (3, 4, 5, 6, 8),\n",
       "  (3, 4, 5, 6, 9),\n",
       "  (3, 4, 5, 6, 10),\n",
       "  (3, 4, 5, 6, 11),\n",
       "  (3, 4, 5, 7, 8),\n",
       "  (3, 4, 5, 7, 9),\n",
       "  (3, 4, 5, 7, 10),\n",
       "  (3, 4, 5, 7, 11),\n",
       "  (3, 4, 5, 8, 9),\n",
       "  (3, 4, 5, 8, 10),\n",
       "  (3, 4, 5, 8, 11),\n",
       "  (3, 4, 5, 9, 10),\n",
       "  (3, 4, 5, 9, 11),\n",
       "  (3, 4, 5, 10, 11),\n",
       "  (3, 4, 6, 7, 8),\n",
       "  (3, 4, 6, 7, 9),\n",
       "  (3, 4, 6, 7, 10),\n",
       "  (3, 4, 6, 7, 11),\n",
       "  (3, 4, 6, 8, 9),\n",
       "  (3, 4, 6, 8, 10),\n",
       "  (3, 4, 6, 8, 11),\n",
       "  (3, 4, 6, 9, 10),\n",
       "  (3, 4, 6, 9, 11),\n",
       "  (3, 4, 6, 10, 11),\n",
       "  (3, 4, 7, 8, 9),\n",
       "  (3, 4, 7, 8, 10),\n",
       "  (3, 4, 7, 8, 11),\n",
       "  (3, 4, 7, 9, 10),\n",
       "  (3, 4, 7, 9, 11),\n",
       "  (3, 4, 7, 10, 11),\n",
       "  (3, 4, 8, 9, 10),\n",
       "  (3, 4, 8, 9, 11),\n",
       "  (3, 4, 8, 10, 11),\n",
       "  (3, 4, 9, 10, 11),\n",
       "  (3, 5, 6, 7, 8),\n",
       "  (3, 5, 6, 7, 9),\n",
       "  (3, 5, 6, 7, 10),\n",
       "  (3, 5, 6, 7, 11),\n",
       "  (3, 5, 6, 8, 9),\n",
       "  (3, 5, 6, 8, 10),\n",
       "  (3, 5, 6, 8, 11),\n",
       "  (3, 5, 6, 9, 10),\n",
       "  (3, 5, 6, 9, 11),\n",
       "  (3, 5, 6, 10, 11),\n",
       "  (3, 5, 7, 8, 9),\n",
       "  (3, 5, 7, 8, 10),\n",
       "  (3, 5, 7, 8, 11),\n",
       "  (3, 5, 7, 9, 10),\n",
       "  (3, 5, 7, 9, 11),\n",
       "  (3, 5, 7, 10, 11),\n",
       "  (3, 5, 8, 9, 10),\n",
       "  (3, 5, 8, 9, 11),\n",
       "  (3, 5, 8, 10, 11),\n",
       "  (3, 5, 9, 10, 11),\n",
       "  (3, 6, 7, 8, 9),\n",
       "  (3, 6, 7, 8, 10),\n",
       "  (3, 6, 7, 8, 11),\n",
       "  (3, 6, 7, 9, 10),\n",
       "  (3, 6, 7, 9, 11),\n",
       "  (3, 6, 7, 10, 11),\n",
       "  (3, 6, 8, 9, 10),\n",
       "  (3, 6, 8, 9, 11),\n",
       "  (3, 6, 8, 10, 11),\n",
       "  (3, 6, 9, 10, 11),\n",
       "  (3, 7, 8, 9, 10),\n",
       "  (3, 7, 8, 9, 11),\n",
       "  (3, 7, 8, 10, 11),\n",
       "  (3, 7, 9, 10, 11),\n",
       "  (3, 8, 9, 10, 11),\n",
       "  (4, 5, 6, 7, 8),\n",
       "  (4, 5, 6, 7, 9),\n",
       "  (4, 5, 6, 7, 10),\n",
       "  (4, 5, 6, 7, 11),\n",
       "  (4, 5, 6, 8, 9),\n",
       "  (4, 5, 6, 8, 10),\n",
       "  (4, 5, 6, 8, 11),\n",
       "  (4, 5, 6, 9, 10),\n",
       "  (4, 5, 6, 9, 11),\n",
       "  (4, 5, 6, 10, 11),\n",
       "  (4, 5, 7, 8, 9),\n",
       "  (4, 5, 7, 8, 10),\n",
       "  (4, 5, 7, 8, 11),\n",
       "  (4, 5, 7, 9, 10),\n",
       "  (4, 5, 7, 9, 11),\n",
       "  (4, 5, 7, 10, 11),\n",
       "  (4, 5, 8, 9, 10),\n",
       "  (4, 5, 8, 9, 11),\n",
       "  (4, 5, 8, 10, 11),\n",
       "  (4, 5, 9, 10, 11),\n",
       "  (4, 6, 7, 8, 9),\n",
       "  (4, 6, 7, 8, 10),\n",
       "  (4, 6, 7, 8, 11),\n",
       "  (4, 6, 7, 9, 10),\n",
       "  (4, 6, 7, 9, 11),\n",
       "  (4, 6, 7, 10, 11),\n",
       "  (4, 6, 8, 9, 10),\n",
       "  (4, 6, 8, 9, 11),\n",
       "  (4, 6, 8, 10, 11),\n",
       "  (4, 6, 9, 10, 11),\n",
       "  (4, 7, 8, 9, 10),\n",
       "  (4, 7, 8, 9, 11),\n",
       "  (4, 7, 8, 10, 11),\n",
       "  (4, 7, 9, 10, 11),\n",
       "  (4, 8, 9, 10, 11),\n",
       "  (5, 6, 7, 8, 9),\n",
       "  (5, 6, 7, 8, 10),\n",
       "  (5, 6, 7, 8, 11),\n",
       "  (5, 6, 7, 9, 10),\n",
       "  (5, 6, 7, 9, 11),\n",
       "  (5, 6, 7, 10, 11),\n",
       "  (5, 6, 8, 9, 10),\n",
       "  (5, 6, 8, 9, 11),\n",
       "  (5, 6, 8, 10, 11),\n",
       "  (5, 6, 9, 10, 11),\n",
       "  (5, 7, 8, 9, 10),\n",
       "  (5, 7, 8, 9, 11),\n",
       "  (5, 7, 8, 10, 11),\n",
       "  (5, 7, 9, 10, 11),\n",
       "  (5, 8, 9, 10, 11),\n",
       "  (6, 7, 8, 9, 10),\n",
       "  (6, 7, 8, 9, 11),\n",
       "  (6, 7, 8, 10, 11),\n",
       "  (6, 7, 9, 10, 11),\n",
       "  (6, 8, 9, 10, 11),\n",
       "  (7, 8, 9, 10, 11)],\n",
       " [(0, 1, 2, 3),\n",
       "  (0, 1, 2, 4),\n",
       "  (0, 1, 2, 5),\n",
       "  (0, 1, 2, 6),\n",
       "  (0, 1, 2, 7),\n",
       "  (0, 1, 2, 8),\n",
       "  (0, 1, 3, 4),\n",
       "  (0, 1, 3, 5),\n",
       "  (0, 1, 3, 6),\n",
       "  (0, 1, 3, 7),\n",
       "  (0, 1, 3, 8),\n",
       "  (0, 1, 4, 5),\n",
       "  (0, 1, 4, 6),\n",
       "  (0, 1, 4, 7),\n",
       "  (0, 1, 4, 8),\n",
       "  (0, 1, 5, 6),\n",
       "  (0, 1, 5, 7),\n",
       "  (0, 1, 5, 8),\n",
       "  (0, 1, 6, 7),\n",
       "  (0, 1, 6, 8),\n",
       "  (0, 1, 7, 8),\n",
       "  (0, 2, 3, 4),\n",
       "  (0, 2, 3, 5),\n",
       "  (0, 2, 3, 6),\n",
       "  (0, 2, 3, 7),\n",
       "  (0, 2, 3, 8),\n",
       "  (0, 2, 4, 5),\n",
       "  (0, 2, 4, 6),\n",
       "  (0, 2, 4, 7),\n",
       "  (0, 2, 4, 8),\n",
       "  (0, 2, 5, 6),\n",
       "  (0, 2, 5, 7),\n",
       "  (0, 2, 5, 8),\n",
       "  (0, 2, 6, 7),\n",
       "  (0, 2, 6, 8),\n",
       "  (0, 2, 7, 8),\n",
       "  (0, 3, 4, 5),\n",
       "  (0, 3, 4, 6),\n",
       "  (0, 3, 4, 7),\n",
       "  (0, 3, 4, 8),\n",
       "  (0, 3, 5, 6),\n",
       "  (0, 3, 5, 7),\n",
       "  (0, 3, 5, 8),\n",
       "  (0, 3, 6, 7),\n",
       "  (0, 3, 6, 8),\n",
       "  (0, 3, 7, 8),\n",
       "  (0, 4, 5, 6),\n",
       "  (0, 4, 5, 7),\n",
       "  (0, 4, 5, 8),\n",
       "  (0, 4, 6, 7),\n",
       "  (0, 4, 6, 8),\n",
       "  (0, 4, 7, 8),\n",
       "  (0, 5, 6, 7),\n",
       "  (0, 5, 6, 8),\n",
       "  (0, 5, 7, 8),\n",
       "  (0, 6, 7, 8),\n",
       "  (1, 2, 3, 4),\n",
       "  (1, 2, 3, 5),\n",
       "  (1, 2, 3, 6),\n",
       "  (1, 2, 3, 7),\n",
       "  (1, 2, 3, 8),\n",
       "  (1, 2, 4, 5),\n",
       "  (1, 2, 4, 6),\n",
       "  (1, 2, 4, 7),\n",
       "  (1, 2, 4, 8),\n",
       "  (1, 2, 5, 6),\n",
       "  (1, 2, 5, 7),\n",
       "  (1, 2, 5, 8),\n",
       "  (1, 2, 6, 7),\n",
       "  (1, 2, 6, 8),\n",
       "  (1, 2, 7, 8),\n",
       "  (1, 3, 4, 5),\n",
       "  (1, 3, 4, 6),\n",
       "  (1, 3, 4, 7),\n",
       "  (1, 3, 4, 8),\n",
       "  (1, 3, 5, 6),\n",
       "  (1, 3, 5, 7),\n",
       "  (1, 3, 5, 8),\n",
       "  (1, 3, 6, 7),\n",
       "  (1, 3, 6, 8),\n",
       "  (1, 3, 7, 8),\n",
       "  (1, 4, 5, 6),\n",
       "  (1, 4, 5, 7),\n",
       "  (1, 4, 5, 8),\n",
       "  (1, 4, 6, 7),\n",
       "  (1, 4, 6, 8),\n",
       "  (1, 4, 7, 8),\n",
       "  (1, 5, 6, 7),\n",
       "  (1, 5, 6, 8),\n",
       "  (1, 5, 7, 8),\n",
       "  (1, 6, 7, 8),\n",
       "  (2, 3, 4, 5),\n",
       "  (2, 3, 4, 6),\n",
       "  (2, 3, 4, 7),\n",
       "  (2, 3, 4, 8),\n",
       "  (2, 3, 5, 6),\n",
       "  (2, 3, 5, 7),\n",
       "  (2, 3, 5, 8),\n",
       "  (2, 3, 6, 7),\n",
       "  (2, 3, 6, 8),\n",
       "  (2, 3, 7, 8),\n",
       "  (2, 4, 5, 6),\n",
       "  (2, 4, 5, 7),\n",
       "  (2, 4, 5, 8),\n",
       "  (2, 4, 6, 7),\n",
       "  (2, 4, 6, 8),\n",
       "  (2, 4, 7, 8),\n",
       "  (2, 5, 6, 7),\n",
       "  (2, 5, 6, 8),\n",
       "  (2, 5, 7, 8),\n",
       "  (2, 6, 7, 8),\n",
       "  (3, 4, 5, 6),\n",
       "  (3, 4, 5, 7),\n",
       "  (3, 4, 5, 8),\n",
       "  (3, 4, 6, 7),\n",
       "  (3, 4, 6, 8),\n",
       "  (3, 4, 7, 8),\n",
       "  (3, 5, 6, 7),\n",
       "  (3, 5, 6, 8),\n",
       "  (3, 5, 7, 8),\n",
       "  (3, 6, 7, 8),\n",
       "  (4, 5, 6, 7),\n",
       "  (4, 5, 6, 8),\n",
       "  (4, 5, 7, 8),\n",
       "  (4, 6, 7, 8),\n",
       "  (5, 6, 7, 8)],\n",
       " [(0, 1, 2),\n",
       "  (0, 1, 3),\n",
       "  (0, 1, 4),\n",
       "  (0, 1, 5),\n",
       "  (0, 1, 6),\n",
       "  (0, 2, 3),\n",
       "  (0, 2, 4),\n",
       "  (0, 2, 5),\n",
       "  (0, 2, 6),\n",
       "  (0, 3, 4),\n",
       "  (0, 3, 5),\n",
       "  (0, 3, 6),\n",
       "  (0, 4, 5),\n",
       "  (0, 4, 6),\n",
       "  (0, 5, 6),\n",
       "  (1, 2, 3),\n",
       "  (1, 2, 4),\n",
       "  (1, 2, 5),\n",
       "  (1, 2, 6),\n",
       "  (1, 3, 4),\n",
       "  (1, 3, 5),\n",
       "  (1, 3, 6),\n",
       "  (1, 4, 5),\n",
       "  (1, 4, 6),\n",
       "  (1, 5, 6),\n",
       "  (2, 3, 4),\n",
       "  (2, 3, 5),\n",
       "  (2, 3, 6),\n",
       "  (2, 4, 5),\n",
       "  (2, 4, 6),\n",
       "  (2, 5, 6),\n",
       "  (3, 4, 5),\n",
       "  (3, 4, 6),\n",
       "  (3, 5, 6),\n",
       "  (4, 5, 6)]]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "combinations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 3), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 4), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 5), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 2, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 4), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 5), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 3, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 5), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 4, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 5, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 6, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 1, 7, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 4), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 5), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 7), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 3, 8), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 5), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (1, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (2, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (3, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (3, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (3, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 6), (4, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 1, 2)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 1, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 1, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 1, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 1, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 3, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 3, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 3, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 4, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 4, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (0, 5, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (1, 2, 3)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (1, 2, 4)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (1, 2, 5)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (1, 2, 6)),\n",
       " ((0, 1, 2, 3, 4), (0, 2, 4, 7), (1, 3, 4)),\n",
       " ...]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final_combinations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# task_counts = [2, 3, 5]\n",
    "# server_counts = [4, 4, 4]\n",
    "# tasks = [2, 2, 11]\n",
    "# servers = [3, 4, 1]\n",
    "# total_tasks = sum(tasks)\n",
    "# total_servers = sum(servers)\n",
    "# assignments = []\n",
    "# level_num = len(tasks)\n",
    "# last_level_num = level_num-1\n",
    "# 分配最低等级任务给最低等级的业务员\n",
    "# assignment = [(level_num, level_num, servers[last_level_num])]\n",
    "# 剩余servers[:last_level_num]  随机分配到task[:last_level_num+1]\n",
    "\n",
    "\n",
    "# 分配用什么格式的数据\n",
    "\n",
    "# 任务等级 业务员等级 数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "import itertools"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{(3, 4), (4, 3)}\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "def generate_task_assignments(tasks, servers):\n",
    "    level_num = len(tasks)\n",
    "    last_level_num = level_num - 1\n",
    "    assignments = []\n",
    "\n",
    "    # 分配最低等级任务给最低等级的业务员\n",
    "    assignment = [(level_num, level_num, servers[last_level_num])]\n",
    "    remaining_servers = servers[:last_level_num]\n",
    "\n",
    "    # 生成剩余业务员的排列组合\n",
    "    server_combinations = set(itertools.permutations(remaining_servers))\n",
    "    print(server_combinations)\n",
    "    # 生成满足条件的任务分配方案\n",
    "    for combination in server_combinations:\n",
    "        task_assignment = assignment[:]\n",
    "        for i in range(last_level_num):\n",
    "            level = i\n",
    "            server = combination[i]\n",
    "            if server <= level:\n",
    "                task_assignment.append((level, server, tasks[level]))\n",
    "            else:\n",
    "                # 无法分配的任务使用 -1 表示\n",
    "                task_assignment = []\n",
    "                break\n",
    "        if task_assignment:\n",
    "            assignments.append(task_assignment)\n",
    "\n",
    "    return assignments\n",
    "\n",
    "# 调用函数生成所有分配方案\n",
    "tasks = [2, 2, 11]\n",
    "servers = [3, 4, 1]\n",
    "assignments = generate_task_assignments(tasks, servers)\n",
    "\n",
    "# 打印所有分配方案\n",
    "for assignment in assignments:\n",
    "    print(assignment)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    home  level  day off\n",
      "0     14      1        1\n",
      "6     10      1        2\n",
      "12     3      1        3\n",
      "18     1      1        4\n",
      "24    22      1        5 <class 'pandas.core.frame.DataFrame'> 5\n",
      "    home  level  day off\n",
      "1     11      2        1\n",
      "7      8      2        2\n",
      "13    25      2        3\n",
      "19     5      2        4\n",
      "25    16      2        5 <class 'pandas.core.frame.DataFrame'> 5\n",
      "    home  level  day off\n",
      "2     10      3        1\n",
      "8     17      3        2\n",
      "14     4      3        3\n",
      "20    15      3        4\n",
      "26    19      3        5\n",
      "30    23      3        6\n",
      "35    26      3        7 <class 'pandas.core.frame.DataFrame'> 7\n",
      "    home  level  day off\n",
      "3      9      4        1\n",
      "9      2      4        2\n",
      "15    16      4        3\n",
      "21    11      4        4\n",
      "27    18      4        5\n",
      "31    23      4        6\n",
      "32     1      4        6\n",
      "36    12      4        7\n",
      "37    19      4        7 <class 'pandas.core.frame.DataFrame'> 9\n",
      "    home  level  day off\n",
      "4      3      5        1\n",
      "5     13      5        1\n",
      "10    12      5        2\n",
      "11    21      5        2\n",
      "16     7      5        3\n",
      "17    25      5        3\n",
      "22    15      5        4\n",
      "23    16      5        4\n",
      "28     9      5        5\n",
      "29    10      5        5\n",
      "33     6      5        6\n",
      "34    24      5        6\n",
      "38     2      5        7\n",
      "39    18      5        7 <class 'pandas.core.frame.DataFrame'> 14\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [],
   "source": [
    "# decision_space = []\n",
    "\n",
    "# # 遍历任务等级\n",
    "# for level in sorted(task_counts.index):\n",
    "#     # 获取当前等级的任务数量\n",
    "#     current_task_count = task_counts[level]\n",
    "\n",
    "#     # 获取当前等级及之前的员工数量\n",
    "#     current_employee_count = server_level_counts.loc[:level].sum()\n",
    "\n",
    "#     # 判断是否可以任意分配\n",
    "#     if current_employee_count >= current_task_count:\n",
    "#         # 生成所有可能的决策\n",
    "#         decisions = [(servers_df.loc[i, 'home'], level) for i in range(1, current_employee_count + 1)]\n",
    "#         decision_space.append(decisions)\n",
    "\n",
    "# # 打印决策空间\n",
    "# for decisions in decision_space:\n",
    "#     print(decisions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Server 1 decisions: [(14, 0)]\n",
      "Server 2 decisions: [(11, 0)]\n",
      "Server 3 decisions: [(10, 0)]\n",
      "Server 4 decisions: [(9, 0)]\n",
      "Server 5 decisions: [(3, 0)]\n",
      "Server 6 decisions: [(13, 0)]\n",
      "Server 7 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 8 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 9 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 10 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 11 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 12 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 13 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 14 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 15 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 16 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 17 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 18 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 19 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 20 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 21 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 22 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 23 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 24 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 25 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 26 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 27 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 28 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 29 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 30 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 31 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 32 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 33 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 34 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 35 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 36 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 37 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 38 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 39 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n",
      "Server 40 decisions: [(12, 1), (3, 4), (22, 5), (4, 3), (5, 1), (9, 5), (19, 3), (11, 5), (2, 5), (16, 4), (7, 4), (7, 1), (21, 3), (22, 4), (23, 3), (14, 3), (17, 2), (8, 2), (11, 4), (10, 2), (19, 5), (24, 4), (0, 4), (13, 1), (15, 4), (16, 3), (15, 1), (21, 5), (20, 3), (12, 5), (14, 2), (3, 5), (5, 5), (19, 4), (19, 1), (10, 4), (1, 4), (25, 5), (16, 2), (16, 5), (15, 3), (18, 5), (21, 4)]\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# 创建决策空间B\n",
    "B = []\n",
    "\n",
    "for i in range(1, len(servers_df)+1):\n",
    "    home_city, day_off = A[i-1]\n",
    "    decision_set = set()  # 用于存储每个员工的任务分配方案\n",
    "    for city in initial_state_df.index:\n",
    "        for level in range(1, 6):  # 任务级别从1到5\n",
    "            # 检查约束条件\n",
    "            if initial_state_df.at[city, f'level {level}'] > 0 and (city, level) not in decision_set:\n",
    "                # 如果是员工的周末，将其分配到家中\n",
    "                if day_off == 1:\n",
    "                    decision_set.add((home_city, 0))\n",
    "                # 否则分配到相应的城市和级别\n",
    "                else:\n",
    "                    decision_set.add((city, level))\n",
    "    # 将员工i的决策集合添加到B中\n",
    "\n",
    "    B.append(list(decision_set))\n",
    "\n",
    "# 现在B包含了所有员工的任务分配方案\n",
    "\n",
    "# 打印B中的内容，以便检查\n",
    "for i, decisions in enumerate(B):\n",
    "    print(f\"Server {i + 1} decisions: {decisions}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Shanghai</th>\n",
       "      <th>Zhoushan</th>\n",
       "      <th>Shaoxing</th>\n",
       "      <th>Huzhou</th>\n",
       "      <th>Maanshan</th>\n",
       "      <th>Nantong</th>\n",
       "      <th>ningbo</th>\n",
       "      <th>chizou</th>\n",
       "      <th>Huaibei</th>\n",
       "      <th>Lianyungang</th>\n",
       "      <th>...</th>\n",
       "      <th>zhenjiang</th>\n",
       "      <th>Jinhua</th>\n",
       "      <th>Bengbu</th>\n",
       "      <th>Nanjing</th>\n",
       "      <th>Suzhou</th>\n",
       "      <th>huaian</th>\n",
       "      <th>Hangzhou</th>\n",
       "      <th>Wuxi</th>\n",
       "      <th>Anqing</th>\n",
       "      <th>Lishui</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Shanghai</th>\n",
       "      <td>0.00</td>\n",
       "      <td>145.84</td>\n",
       "      <td>156.19</td>\n",
       "      <td>136.34</td>\n",
       "      <td>288.14</td>\n",
       "      <td>121.87</td>\n",
       "      <td>180.37</td>\n",
       "      <td>392.51</td>\n",
       "      <td>527.73</td>\n",
       "      <td>412.91</td>\n",
       "      <td>...</td>\n",
       "      <td>219.81</td>\n",
       "      <td>294.22</td>\n",
       "      <td>416.88</td>\n",
       "      <td>286.05</td>\n",
       "      <td>508.59</td>\n",
       "      <td>317.38</td>\n",
       "      <td>157.76</td>\n",
       "      <td>107.97</td>\n",
       "      <td>418.88</td>\n",
       "      <td>361.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Zhoushan</th>\n",
       "      <td>145.84</td>\n",
       "      <td>0.00</td>\n",
       "      <td>165.81</td>\n",
       "      <td>200.50</td>\n",
       "      <td>394.74</td>\n",
       "      <td>267.26</td>\n",
       "      <td>89.17</td>\n",
       "      <td>461.78</td>\n",
       "      <td>660.70</td>\n",
       "      <td>558.70</td>\n",
       "      <td>...</td>\n",
       "      <td>354.13</td>\n",
       "      <td>278.94</td>\n",
       "      <td>541.62</td>\n",
       "      <td>410.45</td>\n",
       "      <td>640.24</td>\n",
       "      <td>461.82</td>\n",
       "      <td>189.52</td>\n",
       "      <td>233.06</td>\n",
       "      <td>486.19</td>\n",
       "      <td>312.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Shaoxing</th>\n",
       "      <td>156.19</td>\n",
       "      <td>165.81</td>\n",
       "      <td>0.00</td>\n",
       "      <td>63.84</td>\n",
       "      <td>253.38</td>\n",
       "      <td>224.34</td>\n",
       "      <td>109.58</td>\n",
       "      <td>297.58</td>\n",
       "      <td>540.29</td>\n",
       "      <td>499.18</td>\n",
       "      <td>...</td>\n",
       "      <td>256.08</td>\n",
       "      <td>138.50</td>\n",
       "      <td>412.11</td>\n",
       "      <td>288.48</td>\n",
       "      <td>517.98</td>\n",
       "      <td>385.97</td>\n",
       "      <td>29.18</td>\n",
       "      <td>149.95</td>\n",
       "      <td>321.41</td>\n",
       "      <td>207.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huzhou</th>\n",
       "      <td>136.34</td>\n",
       "      <td>200.50</td>\n",
       "      <td>63.84</td>\n",
       "      <td>0.00</td>\n",
       "      <td>197.79</td>\n",
       "      <td>171.30</td>\n",
       "      <td>165.46</td>\n",
       "      <td>267.15</td>\n",
       "      <td>479.52</td>\n",
       "      <td>436.86</td>\n",
       "      <td>...</td>\n",
       "      <td>192.27</td>\n",
       "      <td>173.90</td>\n",
       "      <td>353.07</td>\n",
       "      <td>226.77</td>\n",
       "      <td>457.54</td>\n",
       "      <td>322.75</td>\n",
       "      <td>40.26</td>\n",
       "      <td>92.00</td>\n",
       "      <td>292.75</td>\n",
       "      <td>255.49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maanshan</th>\n",
       "      <td>288.14</td>\n",
       "      <td>394.74</td>\n",
       "      <td>253.38</td>\n",
       "      <td>197.79</td>\n",
       "      <td>0.00</td>\n",
       "      <td>220.80</td>\n",
       "      <td>361.66</td>\n",
       "      <td>150.08</td>\n",
       "      <td>292.61</td>\n",
       "      <td>335.04</td>\n",
       "      <td>...</td>\n",
       "      <td>120.45</td>\n",
       "      <td>283.55</td>\n",
       "      <td>161.33</td>\n",
       "      <td>68.93</td>\n",
       "      <td>269.52</td>\n",
       "      <td>221.65</td>\n",
       "      <td>224.21</td>\n",
       "      <td>180.83</td>\n",
       "      <td>173.31</td>\n",
       "      <td>372.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nantong</th>\n",
       "      <td>121.87</td>\n",
       "      <td>267.26</td>\n",
       "      <td>224.34</td>\n",
       "      <td>171.30</td>\n",
       "      <td>220.80</td>\n",
       "      <td>0.00</td>\n",
       "      <td>288.06</td>\n",
       "      <td>356.50</td>\n",
       "      <td>416.00</td>\n",
       "      <td>292.72</td>\n",
       "      <td>...</td>\n",
       "      <td>117.50</td>\n",
       "      <td>344.43</td>\n",
       "      <td>316.51</td>\n",
       "      <td>193.49</td>\n",
       "      <td>398.46</td>\n",
       "      <td>195.78</td>\n",
       "      <td>209.62</td>\n",
       "      <td>80.86</td>\n",
       "      <td>382.50</td>\n",
       "      <td>426.66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ningbo</th>\n",
       "      <td>180.37</td>\n",
       "      <td>89.17</td>\n",
       "      <td>109.58</td>\n",
       "      <td>165.46</td>\n",
       "      <td>361.66</td>\n",
       "      <td>288.06</td>\n",
       "      <td>0.00</td>\n",
       "      <td>402.42</td>\n",
       "      <td>644.67</td>\n",
       "      <td>578.45</td>\n",
       "      <td>...</td>\n",
       "      <td>349.14</td>\n",
       "      <td>194.88</td>\n",
       "      <td>518.50</td>\n",
       "      <td>391.65</td>\n",
       "      <td>622.82</td>\n",
       "      <td>471.49</td>\n",
       "      <td>138.50</td>\n",
       "      <td>230.70</td>\n",
       "      <td>425.02</td>\n",
       "      <td>223.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>chizou</th>\n",
       "      <td>392.51</td>\n",
       "      <td>461.78</td>\n",
       "      <td>297.58</td>\n",
       "      <td>267.15</td>\n",
       "      <td>150.08</td>\n",
       "      <td>356.50</td>\n",
       "      <td>402.42</td>\n",
       "      <td>0.00</td>\n",
       "      <td>362.14</td>\n",
       "      <td>473.87</td>\n",
       "      <td>...</td>\n",
       "      <td>269.30</td>\n",
       "      <td>251.38</td>\n",
       "      <td>241.65</td>\n",
       "      <td>214.35</td>\n",
       "      <td>339.34</td>\n",
       "      <td>366.35</td>\n",
       "      <td>272.30</td>\n",
       "      <td>296.58</td>\n",
       "      <td>26.51</td>\n",
       "      <td>322.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huaibei</th>\n",
       "      <td>527.73</td>\n",
       "      <td>660.70</td>\n",
       "      <td>540.29</td>\n",
       "      <td>479.52</td>\n",
       "      <td>292.61</td>\n",
       "      <td>416.00</td>\n",
       "      <td>644.67</td>\n",
       "      <td>362.14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>258.24</td>\n",
       "      <td>...</td>\n",
       "      <td>308.19</td>\n",
       "      <td>572.67</td>\n",
       "      <td>131.94</td>\n",
       "      <td>253.09</td>\n",
       "      <td>23.49</td>\n",
       "      <td>245.23</td>\n",
       "      <td>511.65</td>\n",
       "      <td>427.81</td>\n",
       "      <td>366.59</td>\n",
       "      <td>658.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Lianyungang</th>\n",
       "      <td>412.91</td>\n",
       "      <td>558.70</td>\n",
       "      <td>499.18</td>\n",
       "      <td>436.86</td>\n",
       "      <td>335.04</td>\n",
       "      <td>292.72</td>\n",
       "      <td>578.45</td>\n",
       "      <td>473.87</td>\n",
       "      <td>258.24</td>\n",
       "      <td>0.00</td>\n",
       "      <td>...</td>\n",
       "      <td>250.96</td>\n",
       "      <td>589.50</td>\n",
       "      <td>266.37</td>\n",
       "      <td>266.13</td>\n",
       "      <td>257.18</td>\n",
       "      <td>118.00</td>\n",
       "      <td>476.91</td>\n",
       "      <td>351.01</td>\n",
       "      <td>491.41</td>\n",
       "      <td>679.22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>yancheng</th>\n",
       "      <td>258.08</td>\n",
       "      <td>403.60</td>\n",
       "      <td>359.28</td>\n",
       "      <td>300.56</td>\n",
       "      <td>261.47</td>\n",
       "      <td>140.59</td>\n",
       "      <td>428.66</td>\n",
       "      <td>411.55</td>\n",
       "      <td>337.74</td>\n",
       "      <td>155.95</td>\n",
       "      <td>...</td>\n",
       "      <td>145.01</td>\n",
       "      <td>466.61</td>\n",
       "      <td>278.14</td>\n",
       "      <td>201.52</td>\n",
       "      <td>326.11</td>\n",
       "      <td>92.58</td>\n",
       "      <td>340.64</td>\n",
       "      <td>209.49</td>\n",
       "      <td>434.46</td>\n",
       "      <td>553.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huainan</th>\n",
       "      <td>466.32</td>\n",
       "      <td>584.13</td>\n",
       "      <td>444.70</td>\n",
       "      <td>389.36</td>\n",
       "      <td>191.73</td>\n",
       "      <td>372.37</td>\n",
       "      <td>553.34</td>\n",
       "      <td>230.22</td>\n",
       "      <td>133.97</td>\n",
       "      <td>322.40</td>\n",
       "      <td>...</td>\n",
       "      <td>254.91</td>\n",
       "      <td>455.20</td>\n",
       "      <td>62.83</td>\n",
       "      <td>181.09</td>\n",
       "      <td>112.43</td>\n",
       "      <td>256.58</td>\n",
       "      <td>415.52</td>\n",
       "      <td>359.15</td>\n",
       "      <td>233.10</td>\n",
       "      <td>537.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Taizhou</th>\n",
       "      <td>210.06</td>\n",
       "      <td>350.13</td>\n",
       "      <td>267.14</td>\n",
       "      <td>204.21</td>\n",
       "      <td>153.52</td>\n",
       "      <td>96.94</td>\n",
       "      <td>353.52</td>\n",
       "      <td>302.26</td>\n",
       "      <td>319.74</td>\n",
       "      <td>232.93</td>\n",
       "      <td>...</td>\n",
       "      <td>33.07</td>\n",
       "      <td>359.84</td>\n",
       "      <td>220.82</td>\n",
       "      <td>106.11</td>\n",
       "      <td>301.81</td>\n",
       "      <td>119.01</td>\n",
       "      <td>244.11</td>\n",
       "      <td>122.82</td>\n",
       "      <td>326.35</td>\n",
       "      <td>448.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wenzhou</th>\n",
       "      <td>359.15</td>\n",
       "      <td>275.66</td>\n",
       "      <td>221.57</td>\n",
       "      <td>281.23</td>\n",
       "      <td>431.87</td>\n",
       "      <td>445.42</td>\n",
       "      <td>191.49</td>\n",
       "      <td>401.86</td>\n",
       "      <td>723.42</td>\n",
       "      <td>717.44</td>\n",
       "      <td>...</td>\n",
       "      <td>468.98</td>\n",
       "      <td>153.25</td>\n",
       "      <td>591.50</td>\n",
       "      <td>484.59</td>\n",
       "      <td>700.10</td>\n",
       "      <td>601.86</td>\n",
       "      <td>240.99</td>\n",
       "      <td>371.25</td>\n",
       "      <td>415.73</td>\n",
       "      <td>88.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Chuzhou</th>\n",
       "      <td>316.58</td>\n",
       "      <td>441.70</td>\n",
       "      <td>318.24</td>\n",
       "      <td>257.07</td>\n",
       "      <td>84.02</td>\n",
       "      <td>220.54</td>\n",
       "      <td>422.21</td>\n",
       "      <td>216.86</td>\n",
       "      <td>222.48</td>\n",
       "      <td>257.33</td>\n",
       "      <td>...</td>\n",
       "      <td>103.02</td>\n",
       "      <td>365.07</td>\n",
       "      <td>100.53</td>\n",
       "      <td>31.23</td>\n",
       "      <td>200.66</td>\n",
       "      <td>151.01</td>\n",
       "      <td>289.82</td>\n",
       "      <td>211.12</td>\n",
       "      <td>235.62</td>\n",
       "      <td>454.46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>suzhou</th>\n",
       "      <td>87.81</td>\n",
       "      <td>208.50</td>\n",
       "      <td>132.50</td>\n",
       "      <td>80.26</td>\n",
       "      <td>200.56</td>\n",
       "      <td>92.24</td>\n",
       "      <td>207.50</td>\n",
       "      <td>308.61</td>\n",
       "      <td>452.27</td>\n",
       "      <td>372.35</td>\n",
       "      <td>...</td>\n",
       "      <td>146.13</td>\n",
       "      <td>254.14</td>\n",
       "      <td>335.38</td>\n",
       "      <td>203.79</td>\n",
       "      <td>431.97</td>\n",
       "      <td>263.98</td>\n",
       "      <td>117.54</td>\n",
       "      <td>24.61</td>\n",
       "      <td>335.10</td>\n",
       "      <td>334.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>zhenjiang</th>\n",
       "      <td>219.81</td>\n",
       "      <td>354.13</td>\n",
       "      <td>256.08</td>\n",
       "      <td>192.27</td>\n",
       "      <td>120.45</td>\n",
       "      <td>117.50</td>\n",
       "      <td>349.14</td>\n",
       "      <td>269.30</td>\n",
       "      <td>308.19</td>\n",
       "      <td>250.96</td>\n",
       "      <td>...</td>\n",
       "      <td>0.00</td>\n",
       "      <td>338.59</td>\n",
       "      <td>200.13</td>\n",
       "      <td>76.93</td>\n",
       "      <td>288.80</td>\n",
       "      <td>133.54</td>\n",
       "      <td>231.02</td>\n",
       "      <td>121.54</td>\n",
       "      <td>293.30</td>\n",
       "      <td>428.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Jinhua</th>\n",
       "      <td>294.22</td>\n",
       "      <td>278.94</td>\n",
       "      <td>138.50</td>\n",
       "      <td>173.90</td>\n",
       "      <td>283.55</td>\n",
       "      <td>344.43</td>\n",
       "      <td>194.88</td>\n",
       "      <td>251.38</td>\n",
       "      <td>572.67</td>\n",
       "      <td>589.50</td>\n",
       "      <td>...</td>\n",
       "      <td>338.59</td>\n",
       "      <td>0.00</td>\n",
       "      <td>440.83</td>\n",
       "      <td>341.34</td>\n",
       "      <td>549.23</td>\n",
       "      <td>471.74</td>\n",
       "      <td>139.44</td>\n",
       "      <td>263.87</td>\n",
       "      <td>267.54</td>\n",
       "      <td>90.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bengbu</th>\n",
       "      <td>416.88</td>\n",
       "      <td>541.62</td>\n",
       "      <td>412.11</td>\n",
       "      <td>353.07</td>\n",
       "      <td>161.33</td>\n",
       "      <td>316.51</td>\n",
       "      <td>518.50</td>\n",
       "      <td>241.65</td>\n",
       "      <td>131.94</td>\n",
       "      <td>266.37</td>\n",
       "      <td>...</td>\n",
       "      <td>200.13</td>\n",
       "      <td>440.83</td>\n",
       "      <td>0.00</td>\n",
       "      <td>131.58</td>\n",
       "      <td>108.59</td>\n",
       "      <td>194.00</td>\n",
       "      <td>383.17</td>\n",
       "      <td>311.65</td>\n",
       "      <td>251.12</td>\n",
       "      <td>527.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nanjing</th>\n",
       "      <td>286.05</td>\n",
       "      <td>410.45</td>\n",
       "      <td>288.48</td>\n",
       "      <td>226.77</td>\n",
       "      <td>68.93</td>\n",
       "      <td>193.49</td>\n",
       "      <td>391.65</td>\n",
       "      <td>214.35</td>\n",
       "      <td>253.09</td>\n",
       "      <td>266.13</td>\n",
       "      <td>...</td>\n",
       "      <td>76.93</td>\n",
       "      <td>341.34</td>\n",
       "      <td>131.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>231.49</td>\n",
       "      <td>153.20</td>\n",
       "      <td>260.32</td>\n",
       "      <td>180.13</td>\n",
       "      <td>235.52</td>\n",
       "      <td>431.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Suzhou</th>\n",
       "      <td>508.59</td>\n",
       "      <td>640.24</td>\n",
       "      <td>517.98</td>\n",
       "      <td>457.54</td>\n",
       "      <td>269.52</td>\n",
       "      <td>398.46</td>\n",
       "      <td>622.82</td>\n",
       "      <td>339.34</td>\n",
       "      <td>23.49</td>\n",
       "      <td>257.18</td>\n",
       "      <td>...</td>\n",
       "      <td>288.80</td>\n",
       "      <td>549.23</td>\n",
       "      <td>108.59</td>\n",
       "      <td>231.49</td>\n",
       "      <td>0.00</td>\n",
       "      <td>233.58</td>\n",
       "      <td>489.26</td>\n",
       "      <td>407.57</td>\n",
       "      <td>344.27</td>\n",
       "      <td>635.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>huaian</th>\n",
       "      <td>317.38</td>\n",
       "      <td>461.82</td>\n",
       "      <td>385.97</td>\n",
       "      <td>322.75</td>\n",
       "      <td>221.65</td>\n",
       "      <td>195.78</td>\n",
       "      <td>471.49</td>\n",
       "      <td>366.35</td>\n",
       "      <td>245.23</td>\n",
       "      <td>118.00</td>\n",
       "      <td>...</td>\n",
       "      <td>133.54</td>\n",
       "      <td>471.74</td>\n",
       "      <td>194.00</td>\n",
       "      <td>153.20</td>\n",
       "      <td>233.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>362.37</td>\n",
       "      <td>241.07</td>\n",
       "      <td>386.14</td>\n",
       "      <td>561.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Hangzhou</th>\n",
       "      <td>157.76</td>\n",
       "      <td>189.52</td>\n",
       "      <td>29.18</td>\n",
       "      <td>40.26</td>\n",
       "      <td>224.21</td>\n",
       "      <td>209.62</td>\n",
       "      <td>138.50</td>\n",
       "      <td>272.30</td>\n",
       "      <td>511.65</td>\n",
       "      <td>476.91</td>\n",
       "      <td>...</td>\n",
       "      <td>231.02</td>\n",
       "      <td>139.44</td>\n",
       "      <td>383.17</td>\n",
       "      <td>260.32</td>\n",
       "      <td>489.26</td>\n",
       "      <td>362.37</td>\n",
       "      <td>0.00</td>\n",
       "      <td>131.58</td>\n",
       "      <td>296.67</td>\n",
       "      <td>217.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wuxi</th>\n",
       "      <td>107.97</td>\n",
       "      <td>233.06</td>\n",
       "      <td>149.95</td>\n",
       "      <td>92.00</td>\n",
       "      <td>180.83</td>\n",
       "      <td>80.86</td>\n",
       "      <td>230.70</td>\n",
       "      <td>296.58</td>\n",
       "      <td>427.81</td>\n",
       "      <td>351.01</td>\n",
       "      <td>...</td>\n",
       "      <td>121.54</td>\n",
       "      <td>263.87</td>\n",
       "      <td>311.65</td>\n",
       "      <td>180.13</td>\n",
       "      <td>407.57</td>\n",
       "      <td>241.07</td>\n",
       "      <td>131.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>323.09</td>\n",
       "      <td>347.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Anqing</th>\n",
       "      <td>418.88</td>\n",
       "      <td>486.19</td>\n",
       "      <td>321.41</td>\n",
       "      <td>292.75</td>\n",
       "      <td>173.31</td>\n",
       "      <td>382.50</td>\n",
       "      <td>425.02</td>\n",
       "      <td>26.51</td>\n",
       "      <td>366.59</td>\n",
       "      <td>491.41</td>\n",
       "      <td>...</td>\n",
       "      <td>293.30</td>\n",
       "      <td>267.54</td>\n",
       "      <td>251.12</td>\n",
       "      <td>235.52</td>\n",
       "      <td>344.27</td>\n",
       "      <td>386.14</td>\n",
       "      <td>296.67</td>\n",
       "      <td>323.09</td>\n",
       "      <td>0.00</td>\n",
       "      <td>333.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Lishui</th>\n",
       "      <td>361.50</td>\n",
       "      <td>312.30</td>\n",
       "      <td>207.70</td>\n",
       "      <td>255.49</td>\n",
       "      <td>372.19</td>\n",
       "      <td>426.66</td>\n",
       "      <td>223.14</td>\n",
       "      <td>322.16</td>\n",
       "      <td>658.70</td>\n",
       "      <td>679.22</td>\n",
       "      <td>...</td>\n",
       "      <td>428.24</td>\n",
       "      <td>90.26</td>\n",
       "      <td>527.30</td>\n",
       "      <td>431.26</td>\n",
       "      <td>635.23</td>\n",
       "      <td>561.57</td>\n",
       "      <td>217.31</td>\n",
       "      <td>347.28</td>\n",
       "      <td>333.78</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             Shanghai  Zhoushan  Shaoxing  Huzhou  Maanshan  Nantong  ningbo  \\\n",
       "Shanghai         0.00    145.84    156.19  136.34    288.14   121.87  180.37   \n",
       "Zhoushan       145.84      0.00    165.81  200.50    394.74   267.26   89.17   \n",
       "Shaoxing       156.19    165.81      0.00   63.84    253.38   224.34  109.58   \n",
       "Huzhou         136.34    200.50     63.84    0.00    197.79   171.30  165.46   \n",
       "Maanshan       288.14    394.74    253.38  197.79      0.00   220.80  361.66   \n",
       "Nantong        121.87    267.26    224.34  171.30    220.80     0.00  288.06   \n",
       "ningbo         180.37     89.17    109.58  165.46    361.66   288.06    0.00   \n",
       "chizou         392.51    461.78    297.58  267.15    150.08   356.50  402.42   \n",
       "Huaibei        527.73    660.70    540.29  479.52    292.61   416.00  644.67   \n",
       "Lianyungang    412.91    558.70    499.18  436.86    335.04   292.72  578.45   \n",
       "yancheng       258.08    403.60    359.28  300.56    261.47   140.59  428.66   \n",
       "Huainan        466.32    584.13    444.70  389.36    191.73   372.37  553.34   \n",
       "Taizhou        210.06    350.13    267.14  204.21    153.52    96.94  353.52   \n",
       "Wenzhou        359.15    275.66    221.57  281.23    431.87   445.42  191.49   \n",
       "Chuzhou        316.58    441.70    318.24  257.07     84.02   220.54  422.21   \n",
       "suzhou          87.81    208.50    132.50   80.26    200.56    92.24  207.50   \n",
       "zhenjiang      219.81    354.13    256.08  192.27    120.45   117.50  349.14   \n",
       "Jinhua         294.22    278.94    138.50  173.90    283.55   344.43  194.88   \n",
       "Bengbu         416.88    541.62    412.11  353.07    161.33   316.51  518.50   \n",
       "Nanjing        286.05    410.45    288.48  226.77     68.93   193.49  391.65   \n",
       "Suzhou         508.59    640.24    517.98  457.54    269.52   398.46  622.82   \n",
       "huaian         317.38    461.82    385.97  322.75    221.65   195.78  471.49   \n",
       "Hangzhou       157.76    189.52     29.18   40.26    224.21   209.62  138.50   \n",
       "Wuxi           107.97    233.06    149.95   92.00    180.83    80.86  230.70   \n",
       "Anqing         418.88    486.19    321.41  292.75    173.31   382.50  425.02   \n",
       "Lishui         361.50    312.30    207.70  255.49    372.19   426.66  223.14   \n",
       "\n",
       "             chizou  Huaibei  Lianyungang  ...  zhenjiang  Jinhua  Bengbu  \\\n",
       "Shanghai     392.51   527.73       412.91  ...     219.81  294.22  416.88   \n",
       "Zhoushan     461.78   660.70       558.70  ...     354.13  278.94  541.62   \n",
       "Shaoxing     297.58   540.29       499.18  ...     256.08  138.50  412.11   \n",
       "Huzhou       267.15   479.52       436.86  ...     192.27  173.90  353.07   \n",
       "Maanshan     150.08   292.61       335.04  ...     120.45  283.55  161.33   \n",
       "Nantong      356.50   416.00       292.72  ...     117.50  344.43  316.51   \n",
       "ningbo       402.42   644.67       578.45  ...     349.14  194.88  518.50   \n",
       "chizou         0.00   362.14       473.87  ...     269.30  251.38  241.65   \n",
       "Huaibei      362.14     0.00       258.24  ...     308.19  572.67  131.94   \n",
       "Lianyungang  473.87   258.24         0.00  ...     250.96  589.50  266.37   \n",
       "yancheng     411.55   337.74       155.95  ...     145.01  466.61  278.14   \n",
       "Huainan      230.22   133.97       322.40  ...     254.91  455.20   62.83   \n",
       "Taizhou      302.26   319.74       232.93  ...      33.07  359.84  220.82   \n",
       "Wenzhou      401.86   723.42       717.44  ...     468.98  153.25  591.50   \n",
       "Chuzhou      216.86   222.48       257.33  ...     103.02  365.07  100.53   \n",
       "suzhou       308.61   452.27       372.35  ...     146.13  254.14  335.38   \n",
       "zhenjiang    269.30   308.19       250.96  ...       0.00  338.59  200.13   \n",
       "Jinhua       251.38   572.67       589.50  ...     338.59    0.00  440.83   \n",
       "Bengbu       241.65   131.94       266.37  ...     200.13  440.83    0.00   \n",
       "Nanjing      214.35   253.09       266.13  ...      76.93  341.34  131.58   \n",
       "Suzhou       339.34    23.49       257.18  ...     288.80  549.23  108.59   \n",
       "huaian       366.35   245.23       118.00  ...     133.54  471.74  194.00   \n",
       "Hangzhou     272.30   511.65       476.91  ...     231.02  139.44  383.17   \n",
       "Wuxi         296.58   427.81       351.01  ...     121.54  263.87  311.65   \n",
       "Anqing        26.51   366.59       491.41  ...     293.30  267.54  251.12   \n",
       "Lishui       322.16   658.70       679.22  ...     428.24   90.26  527.30   \n",
       "\n",
       "             Nanjing  Suzhou  huaian  Hangzhou    Wuxi  Anqing  Lishui  \n",
       "Shanghai      286.05  508.59  317.38    157.76  107.97  418.88  361.50  \n",
       "Zhoushan      410.45  640.24  461.82    189.52  233.06  486.19  312.30  \n",
       "Shaoxing      288.48  517.98  385.97     29.18  149.95  321.41  207.70  \n",
       "Huzhou        226.77  457.54  322.75     40.26   92.00  292.75  255.49  \n",
       "Maanshan       68.93  269.52  221.65    224.21  180.83  173.31  372.19  \n",
       "Nantong       193.49  398.46  195.78    209.62   80.86  382.50  426.66  \n",
       "ningbo        391.65  622.82  471.49    138.50  230.70  425.02  223.14  \n",
       "chizou        214.35  339.34  366.35    272.30  296.58   26.51  322.16  \n",
       "Huaibei       253.09   23.49  245.23    511.65  427.81  366.59  658.70  \n",
       "Lianyungang   266.13  257.18  118.00    476.91  351.01  491.41  679.22  \n",
       "yancheng      201.52  326.11   92.58    340.64  209.49  434.46  553.44  \n",
       "Huainan       181.09  112.43  256.58    415.52  359.15  233.10  537.71  \n",
       "Taizhou       106.11  301.81  119.01    244.11  122.82  326.35  448.61  \n",
       "Wenzhou       484.59  700.10  601.86    240.99  371.25  415.73   88.32  \n",
       "Chuzhou        31.23  200.66  151.01    289.82  211.12  235.62  454.46  \n",
       "suzhou        203.79  431.97  263.98    117.54   24.61  335.10  334.80  \n",
       "zhenjiang      76.93  288.80  133.54    231.02  121.54  293.30  428.24  \n",
       "Jinhua        341.34  549.23  471.74    139.44  263.87  267.54   90.26  \n",
       "Bengbu        131.58  108.59  194.00    383.17  311.65  251.12  527.30  \n",
       "Nanjing         0.00  231.49  153.20    260.32  180.13  235.52  431.26  \n",
       "Suzhou        231.49    0.00  233.58    489.26  407.57  344.27  635.23  \n",
       "huaian        153.20  233.58    0.00    362.37  241.07  386.14  561.57  \n",
       "Hangzhou      260.32  489.26  362.37      0.00  131.58  296.67  217.31  \n",
       "Wuxi          180.13  407.57  241.07    131.58    0.00  323.09  347.28  \n",
       "Anqing        235.52  344.27  386.14    296.67  323.09    0.00  333.78  \n",
       "Lishui        431.26  635.23  561.57    217.31  347.28  333.78    0.00  \n",
       "\n",
       "[26 rows x 26 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city_26 = generate_city_26()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
